Apply css styling in content fragment | Community
Skip to main content
Level 2
October 25, 2018
Solved

Apply css styling in content fragment

  • October 25, 2018
  • 7 replies
  • 8916 views

I want to apply different css styling such as  font-family, color etc to my content in content fragment.

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 arunpatidar

Hi Lokesh,

I didn't try it but I can give a try, though I created a components where you can include CF and if you can add one more dropdown to select style and this style can be directly used in top div or wrapper element.

https://aemlab.blogspot.com/2018/09/aem-content-fragment-with-component.html

7 replies

Lokesh_Shivalingaiah
Level 10
October 25, 2018

Actually, I have a similar usecase for me and couldnt find any option !

arunpatidar
Community Advisor
Community Advisor
October 25, 2018

You can trying this by extending existing content fragment to add style system and based on class selected you can write CSS rules for font and color etc.

Adobe Experience Manager Help | Style System

Arun Patidar
Lokesh_Shivalingaiah
Level 10
October 25, 2018

Have you tried it Arun ? As of today there is no way to create even the template for content fragments from the frontend and need to be created from backend. So just curious to know..

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
October 25, 2018

Hi Lokesh,

I didn't try it but I can give a try, though I created a components where you can include CF and if you can add one more dropdown to select style and this style can be directly used in top div or wrapper element.

https://aemlab.blogspot.com/2018/09/aem-content-fragment-with-component.html

Arun Patidar
Lokesh_Shivalingaiah
Level 10
October 25, 2018

Yes! This is the approach I am using as a workaround for sometime now

smacdonald2008
Level 10
October 25, 2018

Nice discussion Lokesh and Arun. 

Prarthana_Sharm
Level 2
November 21, 2019

I have similar use case where I want to change the style(color, position) of text in different variations. Is this even possible in content fragment or experience fragment?

So the requirement is where we need to update content in one place but stylize content in different variations.

Please suggest.