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

CSS best practices #9

Open
afercia opened this issue Apr 11, 2017 · 0 comments
Open

CSS best practices #9

afercia opened this issue Apr 11, 2017 · 0 comments

Comments

@afercia
Copy link
Contributor

afercia commented Apr 11, 2017

Apart from following the WordPress CSS coding standards, the CSS should also use some best practices. The first one that come into my mind (but there are a lot) are, for example:

1
Don't use element selectors if not strictly necessary. Things like
.settings-fields p.timezone-info
could be simply
.settings-fields .timezone-info

2
Don't use element selectors and also lower specificity as much as possible. Selectors like
.settings-fields .settings-field-control p
should be just
.settings-fields .description

More example welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant