• Not Answered

What is style in SXA and how i can create a class for style that i will add while i will create a custom style

What is style in SXA and how i can create a class for style that i will add in value while i am creating it. I am trying to create a custom style in SXA but in value we need to write a class i dont know how to create a custom classes in SXA. Kindly let me know about it in step by step if someone can help me.

4 Replies

  • Can someone help me on this?
  • Hello
    We are working on same and can help you. can help you. Please check with him.
  • Hi Ashish,

    Basically, classes are similar to general css classes that we are use in normal cshtml file. But when we talk about SXA styles these styles can be assigned to component level - like promo, page content, containers, rich text, etc.,

    You can create a styles under the following folder "/sitecore/content/{Your Tenant}/{Your Style}/Presentation/Styles" - Here you can create a styles under it. It's like you create an item with style name and the field section - value should have your css class name and here you can set the avaible of the classes specific to particular renderings.

    Once you have create the style, Goto presentation details / experience editor and select the particular rendering and goto it's properties and choose the class.

    Now the selected class will applied to the component and you can check the same by inspecting the component on the page.

    Also, Please let me know if you need any info further!

    Thanks,
    Sudheer
  • Hi Ashish,

    You have to perform following steps:

    1. Create the custom css class and add attributes in CSS file.
    2. Go to /sitecore/content/<Tenant>/<Site>/Presentation/Styles and create style item and assign your css class name with compatible rendering.
    3. After this it will start showing style item in your renderings.