Skip to content

[css-variables-2] Is it possible in the future to allow variables to be defined outside the elements' {}? #8159

@LIXiangChen

Description

@LIXiangChen

What I mean is that when defining CSS variables, it is not necessary to write it in the elements' {}, which is equivalent to a syntactic sugar, and the variables are implicitly bound to the :root element.

For example, the following two codes will be equal:

@media (max-width: 800px) {
    --foo: 123;
}
@media (max-width: 800px) {
    :root {
        --foo: 123;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions