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
Add no-unknown-custom-media
#6362
Comments
@jeddy3 Thanks for the proposal. The new rule sounds good to me. 👍🏼
I agree with creating two rules; one is |
SGTM.
Labelling as ready to implement. If anyone fancies contributing this rule, there are steps on how to add a new rule in the Developer guide. |
We will provide a parser function for custom media in the media query parser.
This returns
This should make it possible to handle custom media in the same way as regular media query lists. Rules that handle |
This issue is older than one month. Please ask before opening a pull request, as it may no longer be relevant. |
@fpetrakov Thank you for starting this issue! @romainmenke's package seems to provide |
FYI, we cannot provide the |
|
It is part of this standard : https://www.w3.org/TR/mediaqueries-5/#custom-mq |
Yeah, I guess they are more likely to just make variables work inside media queries than to implement another at-rule, I suppose 😆 |
What is the problem you're trying to solve?
I'd like to disallow unknown custom media queries. For example:
What solution would you like to see?
A new rule to catch this. Like #6361, it's currently available as a plugin but it (perhaps) meets our criteria to be a built-in rule. Unlike #6361, it's for a draft spec. However, we already have a custom media queries rule (custom-media-pattern) and both PostCSS Preset Env and Lightening CSS offer syntax lowering for it.
Interestingly, the plugin also enforces using custom media queries through its
always
andalways-known
primary options. Shall we take the same approach or create two rules?:I'm leaning towards the latter.
no-unknown-custom-media
true
importForm
&resolver
?Unexpected unknown custom media
importForm
secondary option to specify more sources."The text was updated successfully, but these errors were encountered: