wpaccessibility / settings-api-enhanced

An improved WordPress Settings API with default render callbacks and a new accessible layout.
9 stars 0 forks source link

CSS best practices #9

Open afercia opened 7 years ago

afercia commented 7 years ago

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.