finds.dev

philipwalton/responsive-components

A modern approach to styling elements based on the size of their container

View on GitHubHomepage ↗

★ 581JavaScriptApache-2.0updated Jun 2024

// the take

A ResizeObserver-based polyfill for container queries, written before the CSS spec landed natively. It uses class toggling on elements to apply container-aware styles. Interesting primarily as historical documentation of the problem and one pre-spec solution.

The accompanying article explains the container query problem clearly and is still worth reading. The demo site shows real-world use cases (cards, calendars, galleries) that make the concept concrete. The implementation is lightweight — no framework, just ResizeObserver and class manipulation.

Native CSS container queries shipped in all major browsers in 2023, making this approach obsolete for any new project. The repo hasn't been meaningfully updated since 2019 despite the 2024 touch; it's effectively archived. The build system is Gulp with a Node 12-era dependency tree that likely won't install cleanly on modern Node. There's no migration path or note pointing users toward the CSS-native approach.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
581
Forks
40
Language
JavaScript
License
Apache-2.0
Last commit
11 Jun 2024

// nearby

If responsive-components isn't quite it.

All repos →