Skip to content

CSS should not use :not #11677

@jdevalk

Description

@jdevalk

Currently, we have a lot of CSS that is very non-performant, but also not very readable. Specifically, I think we shouldn't use :not as much, in things like:

.wp-block-button__link:not(.has-background):active

and

.wp-block-button__link:not(.has-text-color),.wp-block-button__link:not(.has-text-color):active,.wp-block-button__link:not(.has-text-color):focus,.wp-block-button__link:not(.has-text-color):hover{
    color:#fff
}

This is very slow for browsers to parse, but they're also very hard to read. Our example CSS is going to be built upon a lot, so it needs to be a bit better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSS StylingRelated to editor and front end styles, CSS-specific issues.[Type] Code QualityIssues or PRs that relate to code quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions