Re: [csswg-drafts] [mediaqueries-5] Define logical evaluation steps for custom media (#7725)

I think I get what you mean.
In a browser context the custom media query can be evaluated on its own after which they would be equivalent to using `true` or `false` in the final media query.

```css
@custom-media --modern (color), (hover);

@media (--modern) and (width > 1024px) {
  .a { color: green; }
}

/* when hover or color */
@media (true) and (width > 1024px) {
  .a { color: green; }
}

/* when not hover or color */
@media (false) and (width > 1024px) {
  .a { color: green; }
}
```

I don't think there is a good analogue for this purely with text substitution.
But I will try to patch the plugin so that what is possible works correctly and that other cases throw warnings.

> If PostCSS is just dropping the media type from the custom MQ, it's simply wrong.

It is indeed very wrong at the moment and this is something I am trying to correct for a whole range of plugins. Either they shouldn't be advertised as polyfills for native features or they must follow the spec exactly.

---

Closing as my question was answered and I don't think any changes are needed.

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


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

Received on Monday, 12 September 2022 20:53:39 UTC