Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Define how CSS modules interacts with @layer #401

Copy link
Copy link

Description

@jacobrask
Issue body actions

I think all CSS modules by default should end up in a specific CSS layer such as @layer modules or @layer css-modules. This would let you, in a global stylesheet before all CSS modules, declare exactly where modules should be placed in the order of layers, such as:

@layer reset, theme, css-modules, utilities;

Since CSS modules are about encapsulation they pair very well with @layer. A CSS module will then not only not affect global styles through global selectors, it would also have a well-defined specificity that can be overridden by CSS included through other methods.

By making this part of the CSS modules specification, tools and frameworks can also make assumptions about where they want to place other types of styles.

Reactions are currently unavailable

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.