Add custom css file to RTE at the component level | Community
Skip to main content
Level 2
May 26, 2021
Solved

Add custom css file to RTE at the component level

  • May 26, 2021
  • 2 replies
  • 1332 views

I have been trying to add custom css file the should be specifically applied to the RTE component.

 

The main intentions in this requirements are:

1) Custom css code to be applied to RTE at the component level itself.

2) The rendered content of RTE should be automatically applied with the custom css code and rendered of the page.

 

Can this be achieved by adding any specific property to dialog nodes or any other way to integrate the CSS file to the component? Appreciate ur help.

 

 

 

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 Asutosh_Jena_

Hi @parthibanselvam 

 

You can apply the classes to the RTE content and write CSS styles based on the classes that is applied on the RTE content which will be applied to the content on the page while rendering.

 

You can create the styles under the RTE component like below.

 

It will be applied as a <span> tag like below:

 

 

2 replies

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
May 26, 2021

Hi @parthibanselvam 

 

You can apply the classes to the RTE content and write CSS styles based on the classes that is applied on the RTE content which will be applied to the content on the page while rendering.

 

You can create the styles under the RTE component like below.

 

It will be applied as a <span> tag like below:

 

 

Level 2
May 26, 2021

Hi @asutosh_jena_ ,

I completely understood ur proposed idea. However we are trying to implement the css as a built-in feature with the component itself.

Rather the styles be applied manually during the RTE component authoring. How can we possibly approach this?

Level 2
May 28, 2021
@asutosh_jena_ , is it possible to make a custom css file get applied to the RTE text inside the dialog box itself, i.e, the styles and other css effects are visible inside the RTE text box itself