layoutgenentitystyles
A web page can be viewed as a collection of blocks, with the theme providing the necessary styles for presentation.
The traditional approach involves creating styles directly within the theme. However, for websites that evolve over time (with the addition of new sections or pages), maintenance becomes increasingly complex after several months or years.
Our approach involves using two style files:
- A file containing the base styles.
- A file whose content is dynamically generated based on the active sections.
In the Drupal environment, this translates to the use of layouts that include styles (SCSS/JS). Any entity that supports layouts can have its own styles. This also allows us to reuse sections across different websites.
A significant drawback:
This approach requires setting up an environment that adheres to a specific logic.
Required Modules and Themes:
These modules include additional dependencies, which are automatically downloaded.
You can also use the installation profile: Drupal Project Habeuk.