Hi Team,
Please suggest a solution for this. I have a single component and single template used in both projects — project1 and project2. Now, I want to apply different styles: white and grey for myproject1, and purple and blue for myproject2.
Thanks in Advance
Veera
Solved! Go to Solution.
Views
Replies
Total Likes
Maybe you can try using Style System, if style change is for a component.
However the better solution is to inject additional project specific CSS from context-aware-config or via root page properties
Maybe you can try using Style System, if style change is for a component.
However the better solution is to inject additional project specific CSS from context-aware-config or via root page properties
Hi @veerareddyc1015 ,
There are multiple ways of handling this. First recommendation would be to follow BEM naming convention.
e.g. cmp-component--bg-white, cmp-component--bg-grey
Benefits: Defining styles becomes simpler. Either using LESS or SASS.
Then leverage style system functionality (Style System | Adobe Experience Manager), where you can play with UI skin of component across places. Even on same template also, you can use different skin of component by picking different style system.
Thanks,
Vishal
You can try these points:-
Use the AEM Style System – Enable it in your component (cq:styleGroups).
Create separate editable templates for each project under /conf/project1 and /conf/project2.
Define different policies in each template:
Project1: Styles = White, Grey
Project2: Styles = Purple, Blue
Add corresponding CSS classes in each project’s clientlibs.
No need to duplicate the component – reuse the same component with project-specific style policies.
This keeps the setup clean, scalable, and easy to manage per project.
Let me know if you need help with any of the above points.
Context-aware configuration might be a better solution for your usecase. Read this for more details on CA-config https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-blogs/context-aware-config...