How to add styling to a component without adding in policies of the component | Community
Skip to main content
Level 2
July 15, 2024
Solved

How to add styling to a component without adding in policies of the component

  • July 15, 2024
  • 1 reply
  • 722 views

I require adding styling to an aem component but do not wish to add these in the aem styling system or the policies within a component in editable templates. Is this achievable? 

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 DivrajSingh

@rekhaad7473 : Need to understand where else do you think of adding the styles if are not preferring AEM styling system.

In general, any styles that needs to be used on a page/component have to be driven by client library and if that client library is included in the template code (policies is one way to do so in editable template) then your styles are rendered for component/referring elements. If there is any specific reason to not include in policies - then you can add those styles as a custom client library and include it in your template. [read more details]

If you have anything specific to AEM Guides - we can share further input.

 

As a side note: the right channel for such generic AEM Sites template questions is AEM Sites community

1 reply

DivrajSingh
Adobe Employee
DivrajSinghAdobe EmployeeAccepted solution
Adobe Employee
July 16, 2024

@rekhaad7473 : Need to understand where else do you think of adding the styles if are not preferring AEM styling system.

In general, any styles that needs to be used on a page/component have to be driven by client library and if that client library is included in the template code (policies is one way to do so in editable template) then your styles are rendered for component/referring elements. If there is any specific reason to not include in policies - then you can add those styles as a custom client library and include it in your template. [read more details]

If you have anything specific to AEM Guides - we can share further input.

 

As a side note: the right channel for such generic AEM Sites template questions is AEM Sites community

Level 2
August 2, 2024

I tried using the Style system and it worked for me. Added the specific styles in the policies of the component. I guess it is achievable by using style system in place of the generic client library way.