Skip to content

New Rule: prefer-media-query-range #442

@DMartens

Description

@DMartens

Rule details

Prefer using media query range syntax over using min/max-*

What type of rule is this?

Suggests an alternate way of doing something

Example code

@media (min-width: 100px) {} /* -> @media (width > 100px) */

@media (min-width: 100px) and (max-width: 200px) {} /* -> @media (100px <= width <= 200px) */

Prior Art

Participation

  • I am willing to submit a pull request to implement this rule.

AI acknowledgment

  • I did not use AI to generate this issue report.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

Additional comments

  • The syntax is baseline available since 2023.
  • The stylelint rule allows to select a preferred style (prefix (min-width: ...) or context (width > ...))

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionfeature

Type

No type

Projects

Status

Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions