Skip to content

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

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 > ...))

Activity

  1. moved this to Needs Triage in Triageon May 4, 2026
  2. added
    acceptedThere is consensus among the team that this change meets the criteria for inclusion
    on May 5, 2026
  3. moved this from Needs Triage to Ready to Implement in Triageon May 5, 2026
  4. nzakas commented on May 5, 2026

    @nzakas
    Member

    Makes sense to me. 👍 Marking as accepted.

  5. Tanujkanti4441 commented on Jun 3, 2026

    @Tanujkanti4441
    Contributor

    @DMartens are you working on this, or would you like me to send a PR?

  6. DMartens commented on Jun 3, 2026

    @DMartens
    ContributorAuthor

    I am sorry I forgot to followup. The rule logic is finished except the fixer as it is hard to create a robust fixer without the access to tokens. I am going to create an issue for this, so we can discuss further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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