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

Rise the specificity of CSS reset rules (and all other rules as well) #494

Closed
Reinmar opened this issue Jul 5, 2017 · 2 comments
Closed
Assignees
Labels
package:theme-lark package:ui status:discussion type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Jul 5, 2017

I added CKEditor samples to CKEditor documentation and guess what? The CKEditor's reset gets overridden by the page styling.

image

The documentation website styles are not very specific. They are actually really common:

image

The .formatted ... styles come from Umberto.

So, the problem that we have is that .ck_reset has very low specificity. It's enough to have .mycontent ul to break that.

I can see that we've been adding rules like .ck_reset_all * which would've the same specificity as .mycontent ul but I'm thinking that perhaps we could do something else.

What if we had a rule that we're always using at least two classes? Like, what if everything had .ck class, so we can always use .ck.ck_reset and then .ck.ck-list__item. That would always give us minimum specificity of 20 which would always override styles like .mycontent ul (which are 11).

@Reinmar Reinmar changed the title Rise the specificity of reset classes Rise the specificity of CSS reset rules (and all other rules as well) Jul 5, 2017
@Reinmar Reinmar added package:theme-lark package:ui status:discussion type:improvement This issue reports a possible enhancement of an existing feature. labels Jul 5, 2017
@oleq
Copy link
Member

oleq commented Jul 12, 2017

What if we had a rule that we're always using at least two classes? Like, what if everything had .ckclass, so we can always use .ck.ck_reset and then .ck.ck-list__item. That would always give us minimum specificity of 20 which would always override styles like .mycontent ul (which are 11).

👍

I'll check this out.

@Reinmar Reinmar added this to the iteration 12 milestone Jul 24, 2017
@Reinmar Reinmar modified the milestones: iteration 13, iteration 12 Sep 5, 2017
@Reinmar Reinmar modified the milestones: iteration 13, iteration 14 Nov 14, 2017
Reinmar added a commit to ckeditor/ckeditor5-ui that referenced this issue Feb 6, 2018
@Reinmar Reinmar modified the milestones: iteration 14, iteration 15 Feb 6, 2018
@jodator
Copy link
Contributor

jodator commented Feb 14, 2018

Also:
selection_056

Due to: .formatted ul styling in umberto.

@oleq oleq self-assigned this Mar 22, 2018
oleq added a commit to ckeditor/ckeditor5-block-quote that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-basic-styles that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-engine that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-editor-classic that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-heading that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-theme-lark that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-link that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-widget that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-image that referenced this issue Mar 23, 2018
oleq added a commit to ckeditor/ckeditor5-ui that referenced this issue Mar 23, 2018
oleq added a commit that referenced this issue Mar 23, 2018
Reinmar added a commit that referenced this issue Mar 29, 2018
Docs: Increased the specificity of CSS rules. Introduced the .ck class for editor UI components. Closes #494.
@Reinmar Reinmar mentioned this issue Oct 9, 2019
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:theme-lark package:ui status:discussion type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

3 participants