Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

How to apply default styles for Components

Avatar

Level 5

Hi Team,

I want to give some default styels for components, in my template I have some group of styling, where like Alignment group(left,right), another group like(color) so In alignment I want left should be default. I used defaultstyleclass in template but when I change other style color then alignment also changing back how can I rectify this ? 

3 Replies

Avatar

Community Advisor

I think decoration tag will help you in above scenario.

See https://experienceleague.adobe.com/docs/experience-manager-64/developing/components/decoration-tag.h...

Imple

 

Umesh_Thakur_0-1674823001423.png

 

Result:

Umesh_Thakur_1-1674823250528.png

 

hope this helps;

Umesh Thakur

Avatar

Level 5

Hi @Umesh_Thakur thanks, but I'm trying to give for core component so I added new policy and there I'm trying to give default style for a particular policy. So for polices this tag won't work right ?

Avatar

Community Advisor

Hi @Tessa_learner1 

 

The default style should help you with this. Can you please check if the other styles that you are adding are having any alignment changes as well? Also, please note that your changes would be overridden on the build if you don't have them in your code.

 

Hope it helps!

Thanks,
Kiran Vedantam