Skip to content

[Style] - Inline style !important and CSS variable scope #62959

Open
@webexpr-dhenriet

Description

Is there any reason to put a !important on all inline styles generated by theme.json ?

.has-black-800-color {
    color: var(--wp--preset--color--black-800) !important;
}

this should be enough ? Would it be possible to remove !important ?

.has-black-800-color {
    color: var(--wp--preset--color--black-800);
}

For CSS variables, why is the scope body and not :root ?

body {
    --wp--preset--color--black: #000000;
}

Would it be possible to encapsulate them in :root ?

:root {
    --wp--preset--color--black: #000000;
}

Metadata

Assignees

No one assigned

    Labels

    CSS StylingRelated to editor and front end styles, CSS-specific issues.[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions