web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

CKEDITOR / Rich Text Editor CSS config

(0) ShareShare
ReportReport
Posted on by

Hi Everyone,

I am trying to get the Rich Text Editor to show styles based on some external CSS files we use for our website.
Configs are below, essentially everything works as expected apart from no styling is applied in the preview or designer windows.

I have removed "Sticky Styles" as I need to prevent all the extra Div wrapper it inserts, I can re-enable it if I find a solution to that but even with StickyStyles enabled the CSS isnt working.
Maybe I need a plugin or something, does anyone have any ideas?

{
	"defaultSupportedProps": {
		"extraPlugins": "accessibilityhelp,autogrow,autolink,basicstyles,blockquote,button,collapser,confighelper,contextmenu,copyformatting,dialog,editorplaceholder,find,floatpanel,iframerestrictor,indentblock,justify,notification,panel,panelbutton,pastefromword,format,selectall",
		"removePlugins": "contextmenu,image,stickystyles,superimage,tableresize,tableselection,tabletools",
		"toolbar": [
			["CopyFormatting"],
			["Styles"],
			["Format"],
			["Bold"],
			["Italic"],
			["Underline"],
			["BulletedList"],
			["Outdent"],
			["Indent"],
			["JustifyLeft"],
			["JustifyCenter"],
			["JustifyRight"],
			["Link"],
			["Unlink"],
			["Undo"],
			["Redo"],
			["RemoveFormat"]
		],
		"forcePasteAsPlainText": true,
		"disableImages": true,
		"stylesSet": "cw_styles:/WebResources/cw_styles",
		"format_tags": "p;h2;h3;h4",
		"contentsCss": [
			"https://use.fortawesome.com/kits/747c3a74/publications/latest/eot.css",
			"https://use.fortawesome.com/kits/747c3a74/publications/latest/woff.css",
			"https://use.fortawesome.com/kits/747c3a74/publications/latest/woff2.css"
		],
		"enterMode": 1
	},
	"showAsTabControl": true,
	"showFullScreenExpander": true,
	"showHtml": true,
	"showPreview": true,
	"showPreviewHeaderWarning": true
}


CKEDITOR.stylesSet.add( 'cw_styles', [
	{name: 'Introduction', element: 'p', attributes: { 'class': 'style style--introduction' }},
    {name: 'List Square', element: 'ul', attributes: { 'class': 'style--list-square style--list-no-bg' }},
    {name: 'List Tick', element: 'ul', attributes: { 'class': 'style--list-tick style--list-no-bg' }},
    {name: 'List Circle', element: 'ul', attributes: { 'class': 'style--list-circle style--list-no-bg' }}
]);

And I can see it applies in the Dev console
pastedimage1670427440511v1.png

  • TarrasQ Profile Picture
    57 on at
    Hi there,  thread resurrection time,
     
    I am about to embark on the same journey, more about fixing up the KA RTE editor to stop applying the Sticky Style.
     
    I see in your code 
    "stylesSet": "cw_styles:/WebResources/cw_styles",
    refences, the other code snippets. which seems simple enough.
     
    Did you work out the css issue, or any other helpful tips?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 89 Most Valuable Professional

#2
11manish Profile Picture

11manish 67 Super User 2026 Season 2

#3
Travis South Profile Picture

Travis South 39

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans