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

Styling direct children within a @supports rule, triggers a linting rule incorrectly #217

Open
peeke opened this issue Apr 2, 2021 · 0 comments

Comments

@peeke
Copy link
Contributor

peeke commented Apr 2, 2021

Targeting direct children within an @supports rule, triggers the following linting error:

missing `display: grid;`
`grid-area` can only be used when the containing root rule has `display: grid;` - add `display: grid;` to the containing root rule or, if this is caused by a media query that overrides `display: grid;`, use `grid: unset`stylelint(kaliber/parent-child-policy)

Snippet: this incorrectly raises the linting error

.component {
  @supports (display: grid) {
    display: grid;
    grid-template-areas: 'content';

    & > .content {
      grid-area: content;
    }
  }
}

The following snippet doesn't raise the error (isn't a desirable situation of course, but it might provide a hint as to where things go wrong):

.component {
  @supports (display: grid) {
    display: grid;
    grid-template-areas: 'content';

    & > .content {
      @supports (display: grid) {
        grid-area: content;
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant