Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Rule: no-unlayered-styles #18

Open
1 task
mayank99 opened this issue Nov 27, 2024 · 0 comments
Open
1 task

New Rule: no-unlayered-styles #18

mayank99 opened this issue Nov 27, 2024 · 0 comments
Labels

Comments

@mayank99
Copy link

Rule details

Flag any CSS rules that are outside a @layer block.

What type of rule is this?

Warns about a potential problem

Example code

p {
  color: red;
}

@media (width > 500px) {
  .box {
    padding: 12px;
  }
}

Participation

  • I am willing to submit a pull request to implement this rule.

Additional comments

When working with cascade layers, unlayered styles are usually a mistake. It is easy to forget to wrap the styles in @layer, which is exactly the kind of thing a linter should help with.

This rule probably should be opt-in, because cascade layers aren't being widely used yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant