Skip to content

CSS best practices #9

@afercia

Description

@afercia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions