Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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? 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee

@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

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

@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

Avatar

Level 2

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.