Re: [csswg-drafts] [css-selectors] Proposal for allowing selectors that depend on layout (:stuck, :snap, :on-screen, etc) (#5979)

I am correct in my assumption that this is the style of syntax suggested if we go the container query route?

```css
.header {
  position: sticky;
  top: 0;
}

.header__content {
  font-family: sans-serif;
  padding: 0.6rem 1rem;
}

@container state(stuck) {
  .header__content {
    background-color: teal;
    color: white;
  }
}
```

```html
<header class="header">
  <div class="header__content">Page Title</div>
</header>
<main>
  ...
</main>
```

If so it feels like a good compromise and opens up the potential for lots of states to exist on a container (for better or worse).

-- 
GitHub Notification of comment by Link2Twenty
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5979#issuecomment-1189002803 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 19 July 2022 12:39:28 UTC