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

Some Block CSS contains too much specificity #23170

Closed
markhowellsmead opened this issue Jun 15, 2020 · 3 comments
Closed

Some Block CSS contains too much specificity #23170

markhowellsmead opened this issue Jun 15, 2020 · 3 comments
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.

Comments

@markhowellsmead
Copy link

If the accepted "rules" for BEM naming conventions are applied, the rules for a nested contained element shouldn't be wrapped by the parent class name. This is generally well-applied in the codebase, but there are rules which aren't conformant.

E.g.

.wp-block-media-text .wp-block-media-text__content {

Is: .wp-block-media-text .wp-block-media-text__content {padding: 0 8% 0 8%;}
Should be: .wp-block-media-text__content {padding: 0 8%;}

@oxyc
Copy link
Member

oxyc commented Jun 15, 2020

I know #11779 tracks some of these at least.

The specific example you provided I have a local branch for that I'll try and get in once #23102 and #23062 are merged.

@markhowellsmead
Copy link
Author

Thanks @oxyc.

@annezazu annezazu added [Type] Enhancement A suggestion for improvement. CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Code Quality Issues or PRs that relate to code quality labels Jun 22, 2020
@skorasaurus
Copy link
Member

Thanks for reporting; marking it as closed since the specific issues you raised have been implemented thanks to @oxyc and I agree the CSS can be better scoped in several blocks; there's some issues that address this including but not limited to #17702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants