Is there a way to override sitewide CSS in the UI without editing files? | Community
Skip to main content
September 24, 2024
Solved

Is there a way to override sitewide CSS in the UI without editing files?

  • September 24, 2024
  • 2 replies
  • 870 views

I know this may not be best practice but there is a business case I have which requires being able to give content authors the ability to override sitewide styles.  They don't have access to the file system.  Similar to how some themes in Wordpress have a form field in the theme editor that allows overriding theme styles.  Does this capability exist in AEM?

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 daniel-strmecki

Hello,

I don't think this is available OOTB, but it should be quite simple to do. For example, you can create a site property custom_css and make sure to inject it into the HTML code.

You can override existing CSS using !important, but there might be better ways to do it if you ask a frontend expert.

 

Good luck,

Daniel

2 replies

daniel-strmecki
Community Advisor and Adobe Champion
daniel-strmeckiCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
September 24, 2024

Hello,

I don't think this is available OOTB, but it should be quite simple to do. For example, you can create a site property custom_css and make sure to inject it into the HTML code.

You can override existing CSS using !important, but there might be better ways to do it if you ask a frontend expert.

 

Good luck,

Daniel

h_kataria
Community Advisor
Community Advisor
September 25, 2024

Please check if this helps https://experienceleague.adobe.com/en/docs/experience-manager-65/content/sites/authoring/siteandpage/style-system The custom styles which you need will have to be developed or if they already exist then its just enabling them in the style system and then essentially authors can change it from the UI. 
Hope this helps.