Skip to content

[Feature]: Detect breakpoint chaos and propose a unified scale #29

Description

@nujovich

Which surface does this affect?

Audit / token-generation pipeline (prompts, clustering, scales)

What problem are you trying to solve?

In long-lived codebases the @media (min-width: …) values drift: 768px in one file, 767px in another to avoid an off-by-one, 48em somewhere else, 820px for "tablet-ish". The audit doesn't currently look at media queries at all, so the exported tokens are silent on breakpoints — one of the biggest sources of layout inconsistency.

Proposed solution

Add a breakpoints pass that:

  • Scans every @media rule in the input (and @container where relevant).
  • Normalizes empx (assuming 16px base) and clusters near-duplicates.
  • Proposes a canonical 4–6 step scale (e.g. sm: 640, md: 768, lg: 1024, xl: 1280, 2xl: 1536) anchored to the values actually used.
  • Emits breakpoints in mint-ds.tokens.json and surfaces them in the Tailwind, CSS-variables, and React export targets.

Alternatives you considered

  • Hardcoding Tailwind's defaults — ignores brand-specific viewports.
  • Leaving media queries to a manual step — defeats the "audit everything" pitch.

Additional context

Bonus: warn when two declared breakpoints are within ~16px of each other; that's almost always an accident.

Sanity checks

  • I searched existing issues and didn't find this proposal.
  • This isn't something I could solve with existing CLI flags or playground options.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions