Opened 10 years ago

Last modified 10 years ago

#11297 closed New Feature

Introduce styles applicable to widgets — at Version 5

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone: CKEditor 4.4.0
Component: Core : Styles Version: 4.3
Keywords: Cc: wim.leers@…

Description (last modified by Piotrek Koszuliński)

Problem

It's not possible to apply style to widgets using styles combo. Styles are either applied around widget or inside its nested editables.

Simple solution (outdated)

The simplest solution I can think of is to focus on classes only. A style with a special property denoting that it can be applied to widgets (or somehow generalised "subject"), could only set class(es). That class would be applied to the widget element (only) and then we or widgets authors should make sure that classes are preserved during downcasting.

Classes would of course make it possible to style all parts of widgets, not only widget element.

Why am I proposing only classes? Because styles and other attributes would make this much more complicated. First of all, they could not be applied on elements inside widget and e.g. img is not a widget element in some cases, so how would that style apply a border to it? Second of all, there are cases in which it would not be easy to ensure that all inline styles and attributes are kept during downcasting. A "border" style for image2 for some people should behave differently whether image is captioned or not and that can be achieved only by classes.

Change History (5)

comment:1 Changed 10 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:2 Changed 10 years ago by Olek Nowodziński

cc

comment:3 Changed 10 years ago by Jakub Ś

Status: newconfirmed

comment:4 Changed 10 years ago by Jakub Ś

#11332 was marked as duplicate.

comment:5 Changed 10 years ago by Piotrek Koszuliński

Description: modified (diff)
Milestone: CKEditor 4.4
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