Re: [csswg-drafts] [css-style-attr] Feature suggestion: support for inline media queries in HTML (#12036)

I'm not personally a fan of adding more functionality to style attributes. However, I think if something like this was to be added, it would be more useful to support [nesting](https://drafts.csswg.org/css-nesting-1) in the `style` attribute instead. That would look something like:

```html
<!DOCTYPE html>
<div style="
  border: 6px solid blue; background-color: blue;
  @media (min-width: 640px) { background-color: green; }
  @media (min-width: 1024px) { background-color: yellow; }
  @media (min-width: 1280px) { background-color: orange; }
  ">
</div>
```

I wrote this before realising Crissov already linked to the discussion about allowing nesting here. 😅 But I'll keep this comment as a spelled-out example of what this use case would look like.

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


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

Received on Wednesday, 2 April 2025 10:22:35 UTC