Style system | Community
Skip to main content
July 19, 2019
Solved

Style system

  • July 19, 2019
  • 2 replies
  • 1124 views

Usually the Style system works on the granular level of each and every individual component in an editable template, so may i know how can we have a global style configured and making the global style accessible for all the components.

Is there any best practices or out of box features in aem 6.4  to achieve this.

Note: Global Style eg: bg-color='white', bg-color='grey'  and different viewports.

Thanks in Advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

Use Client Libraries (Clientlibs) to implement Global styles:

  • Create a Global Client Library:

    • Create a client library folder (e.g., /apps/your-project/clientlibs/global) that contains your global styles, such as bg-color-white, bg-color-grey, and viewport-specific styles.
    • Ensure that this client library is configured as categories="global.styles", which can then be included in your pages.
  • Include the Global Client Library in Templates:

    • Reference this global client library in your editable templates.

2 replies

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
August 18, 2024

Use Client Libraries (Clientlibs) to implement Global styles:

  • Create a Global Client Library:

    • Create a client library folder (e.g., /apps/your-project/clientlibs/global) that contains your global styles, such as bg-color-white, bg-color-grey, and viewport-specific styles.
    • Ensure that this client library is configured as categories="global.styles", which can then be included in your pages.
  • Include the Global Client Library in Templates:

    • Reference this global client library in your editable templates.
Aanchal Sikka
kautuk_sahni
Community Manager
Community Manager
August 21, 2024

@jeevar25487230 Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni