Featured Engineering Updated

Container queries changed how we write components

Priya Raman

Frontend Engineer · Pune

  • Jul 18, 2026
  • 2 min read
  • 8
Container queries changed how we write components

Components that respond to their slot, not the viewport, turned out simpler to test. Good frontend engineering in a design system mostly looks like removing things.

Numbers after three months

The token build runs on every merge and publishes a versioned package. Nobody has to remember to run it, which is the only kind of build step that survives a busy quarter.

Moving logic into the stylesheet

The card component had four layout props and eleven media queries. Rewriting it with container queries left one prop and three rules, and the tests finally described what the card did instead of which breakpoint it was in.

  • Version the token package on every merge
  • Prefer visual checks over markup snapshots
  • Delete dead CSS every sprint
  • Document the why next to the code

The component that started it

We replaced most snapshot tests with a handful of visual checks at three container widths. Failures now show a picture of the problem instead of a two-hundred-line diff of class names.

Moving decisions from JavaScript into CSS made the components easier to reason about. The stylesheet now owns layout, and the script owns behaviour, which sounds obvious until you count how often we had crossed that line.

As always, the files and notes behind this piece are in the studio archive. Ask and we will share what we can.

None of this is finished. We will keep adjusting as the product changes, and we will write it down here when something breaks in an interesting way.


Found this useful?

Priya Raman

About the author

Priya Raman

Frontend Engineer · Pune

Priya builds the component library and the token pipeline behind it. She is happiest deleting CSS and writing small tools that make reviews shorter.

Related dispatches

All posts

8 comments

Leave a comment

Already have an account? Log in

Your email is never shown.

  • Luis Ortega

    Author's pick Jul 20, 2026

    Really clear write-up. The list in the middle is going straight into our onboarding doc.

    Priya Raman

    Author Jul 23, 2026

    Roughly six weeks, most of it spent on communication rather than code.

  • Chiara Bianchi

    Jul 27, 2026

    Did you measure anything before and after? I would love to show numbers to our leadership.

    Zara Ahmed

    Jul 28, 2026

    Seconding the request for numbers. Even rough ones would help.

  • Arjun Mehta

    Jul 29, 2026

    The screenshots in the gallery helped a lot. Seeing the before and after side by side made it click.

  • Elin Svensson

    Jul 30, 2026

    We tried something similar last year and stalled at the review step. Your agenda idea might unblock us.

    Priya Raman

    Author Jul 31, 2026

    Glad it helped. The list is adapted from a checklist we keep in the studio wiki.

  • Diego Morales

    Jul 30, 2026

    This matches our experience almost exactly. The renaming pass was painful, but nobody wants to go back.

Previous

Building a palette in OKLCH without losing the brand

Next

Easing curves I keep coming back to