Skip to content

check for initial CSS keyword usage and necessary revert/revert-layer replacements #6665

@mfranzke

Description

@mfranzke

this might be a bigger topic to have a look in our codebase in general, the initial value might not be the best choice, as it would reflect the CSS specs default, and neither the browsers default stylesheet, nor any users choices:

The initial value can be found in the formal syntax section of each CSS property reference page. For example, the initial value of font-size is medium. The initial value should not be confused with the value specified by the browser's style sheet.

source: https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Cascade/Property_value_processing#initial_value

revert might actually be the better choice, as it would still lead to initial in the cascade of choices, but take either the browser stylesheet or users configurations (think of e.g. settings for accessibility) into account:

it resets the property either to user agent set value, to user set value, to its inherited value (if it is inheritable), or to initial value. It can be applied to any CSS property

source: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/revert

Originally posted by @mfranzke in #6269

And in general, we should probably even also evaluate to move to revert-layer, as we're promoting CSS layers nowadays.

Comparison: https://jsbin.com/pukujek/1/edit?html,css,output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions