Expand my Community achievements bar.

SOLVED

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 ? 

1 Accepted Solution

Avatar

Correct answer by
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

View solution in original post

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

Correct answer by
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