Opened 8 years ago

Closed 8 years ago

#13536 closed Bug (duplicate)

Styles combo overrides alignment and indent classes

Reported by: datalink Owned by:
Priority: Normal Milestone:
Component: Core : Styles Version:
Keywords: Cc:


If using justifyClasses and/or indentClasses, after selecting a class from the styles combo (with stylesheetparser enabled) the align and/or indent classes are removed.

Change History (3)

comment:1 Changed 8 years ago by Jakub Ś

Status: newpending
Version: 4.5.1

I have not been able to reproduce this issue.

I have tried e.g. justify classes on H2 element and then applying Italic title style. Classes weren't removed.

Please provide sample file allowing reproducing this problem and/or exact steps explaining what needs to be done to reproduce it.

NOTE: If you are using any custom plugins or have core code modifications, please try reproducing this issue without them.

comment:2 Changed 8 years ago by datalink

I downloaded CKEditor 4.5.1 and seperatly the stylesheetparser plugin.

Open file samples/stylesheetparser.html

Copy following to the config

justifyClasses : [ 'alignleft', 'aligncenter', 'alignright', 'alignjustify' ],
indentClasses : [ 'indent1', 'indent2' ]

Open file samples/assets/sample.css

Copy following at the end of file

p.greenbg {
	background: #afd9a9;
p.greenborder {
	border: 3px solid #18820a;
.alignleft {
	text-align: left;
.aligncenter {
	text-align: center;
.alignright {
	text-align: right;
.alignjustify {
	text-align: justify;
.indent1 {
	margin-left: 40px;
.indent2 {
	margin-left: 80px;

Now open samples/stylesheetparser.html in browser. Click on indent and center text and switch to source. You will see

<p class="indent1 aligncenter">.....

Switch back to editor and select p.greenbg from the styles combo. Switch to source and you will see

<p class="greenbg">.....

The classes indent1 and aligncenter are removed.

A second issue is that you can't select p.greenbg and p.greenborder together. But I think this is the same bug.

Last edited 8 years ago by datalink (previous) (diff)

comment:3 Changed 8 years ago by Jakub Ś

Resolution: duplicate
Status: pendingclosed

Ok, now I can see my mistake - i was assigning classes and inline styles. This is a reason why it has worked in my test.

This issue is a duplicate of #11120.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy