How to apply default styles for Components | Community
Skip to main content
Level 4
January 27, 2023
Solved

How to apply default styles for Components

  • January 27, 2023
  • 2 replies
  • 1926 views

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 ? 

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 Kiran_Vedantam

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

2 replies

Umesh_Thakur
Community Advisor
Community Advisor
January 27, 2023

I think decoration tag will help you in above scenario.

See https://experienceleague.adobe.com/docs/experience-manager-64/developing/components/decoration-tag.html?lang=en#component-controls

Imple

 

 

Result:

 

hope this helps;

Umesh Thakur

Level 4
January 30, 2023

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 ?

Kiran_Vedantam
Community Advisor
Kiran_VedantamCommunity AdvisorAccepted solution
Community Advisor
January 27, 2023

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