Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark each root editable with ".ck-content" class #5323

Closed
Reinmar opened this issue Mar 28, 2017 · 10 comments · Fixed by ckeditor/ckeditor5-ui#365
Closed

Mark each root editable with ".ck-content" class #5323

Reinmar opened this issue Mar 28, 2017 · 10 comments · Fixed by ckeditor/ckeditor5-ui#365
Assignees
Labels
package:ui status:discussion type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Mar 28, 2017

As discussed here ckeditor/ckeditor5-image#74 (comment)

image

Perhaps a more meaningful class to be used in styles for the content would be better.

WDYT?

@oleq
Copy link
Member

oleq commented Mar 28, 2017

It's more or less about .ck-editor__editable vs. .ck-content.

  1. The second one is shorter, which is an advantage for devs styling content inside the CKEditor.
  2. OTOH, it's an additional class to be set for us and a little bit obsolete because of that. It will need to be inserted where .ck-editor__editable already does the job.
  3. OTOH, it's a class about the content, while .ck-editor__editable is about the structure and architecture of the editor itself.

So maybe get rid of .ck-editor__editable and replace it with .ck-content?

@Reinmar
Copy link
Member Author

Reinmar commented Mar 28, 2017

So maybe get rid of .ck-editor__editable and replace it with .ck-content?

I think they have different use cases and can be used together. One is to mark the editable element for the editor UI styles. The other to mark content inside so it can be styled.

@oleq
Copy link
Member

oleq commented Mar 31, 2017

Yes, it makes sense. But OTOH one class cannot live without the other, so we could follow KISS here maybe?

@Reinmar
Copy link
Member Author

Reinmar commented Mar 31, 2017

It certainly can. If all styles for CKEditor content will use .ck-content it'd be a solution for issues like CKEditor5/ckeditor5.github.io#27. You can load that CSS before and add .ck-content class by default so the content is not restyled totally when the editor loads.

@oleq
Copy link
Member

oleq commented Mar 31, 2017

That's a good point, you know. Let's proceed with both .ck-editor__editable and .ck-content then.

@oleq oleq changed the title Mark each root editable with .ck-content class Mark each root editable with ".ck-content" class Jun 20, 2017
@Reinmar
Copy link
Member Author

Reinmar commented Jan 19, 2018

@oleq, do you think that we could do this in iteration 14?

@oleq
Copy link
Member

oleq commented Jan 19, 2018

I think it's a small change so it's doable. It's more about semantics. OTOH, it does not solve our problems with content styles. Or does it?

Anyway, with this change, the widget plugin will add editor-specific styles under .ck-editor__editable (focus outlines, etc.), while the image feature will style the caption text and layout under .ck-content, right?

@Reinmar
Copy link
Member Author

Reinmar commented Jan 19, 2018

I think it's a small change so it's doable. It's more about semantics. OTOH, it does not solve our problems with content styles. Or does it?

No. It's about making it simpler for developers to style the content inside the editor.

Anyway, with this change, the widget plugin will add editor-specific styles under .ck-editor__editable (focus outlines, etc.), while the image feature will style the caption text and layout under .ck-content, right?

Yep.

@oleq
Copy link
Member

oleq commented Jan 19, 2018

What would developers do then to have their styles displayed correctly in the frontend? .ck-content will not be available there. Some PoC?

@Reinmar
Copy link
Member Author

Reinmar commented Jan 19, 2018

These are independent things. Styling the content in the frontend is covered by #773. Here, we discuss how to reliably and easily style the content inside the editor, both – by us and by other developers.

oleq referenced this issue Feb 6, 2018
…ditable CSS class (see ckeditor/ckeditor5-ui#176).
Reinmar referenced this issue in ckeditor/ckeditor5-ui Feb 6, 2018
Reinmar referenced this issue in ckeditor/ckeditor5-ui Feb 6, 2018
Other: Added the `.ck-content` CSS class to the `EditableUIView` in order to simplify styling the editor content. Closes #176.
Reinmar referenced this issue Feb 6, 2018
Docs: Updated docs after adding .ck-content class. See ckeditor/ckeditor5-ui#176.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-ui Oct 9, 2019
@mlewand mlewand added this to the iteration 14 milestone Oct 9, 2019
@mlewand mlewand added status:discussion type:improvement This issue reports a possible enhancement of an existing feature. package:ui labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:ui status:discussion type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants