# marcj/css-element-queries

CSS Element-Queries aka Container Queries. High-speed element dimension/media queries in valid css.

Repository: https://github.com/marcj/css-element-queries
Canonical: https://ross.abutalabs.com/products/css-element-queries
Homepage: http://marcj.github.io/css-element-queries/
Language: JavaScript
License: MIT
License Family: permissive
Topics: css, media-query, element-query, responsive
Last push: 2023-09-28T02:03:39+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4841, "days_push": 1071, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4243, forks 476 (observed 2026-08-28T04:08:40.308743+00:00)

## What it is
A JavaScript polyfill that adds element-based media queries (container queries) to browsers, letting CSS rules respond to an element's dimensions rather than the window viewport. It uses an event-based ResizeSensor for high performance with valid CSS attribute selector syntax.

## Use cases
- make widgets responsive to their container size instead of the viewport
- polyfill container queries in older browsers
- build responsive web components
- serve responsive images based on element width without FOUC
- detect element size changes from CSS transitions, hover states, or DOM mutations

## When to choose
- you need element-level responsiveness in browsers lacking native container query support
- you want a framework-agnostic, valid-CSS-syntax solution
- you need to support legacy browsers like IE10+

## When to avoid
- your target browsers support native CSS container queries (@container)
- you need a modern, actively maintained solution
- you only need viewport-based media queries

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, css-framework
- domain: frontend, web-development, web-design
- platform: browser
- tags: container-queries, polyfill, responsive-design, resize-sensor, element-queries, javascript

## Member repositories
- marcj/css-element-queries (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:40.308743+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:14.074389+00:00, confidence not recorded.
  - readme: https://github.com/marcj/css-element-queries (fetched 2026-08-28T04:08:40.308743+00:00, sha 99b3a68aa1ce)
  - homepage: http://marcj.github.io/css-element-queries/ (fetched 2026-08-29T09:12:14.385608+00:00, sha fcc3a85bba53)
  - registry_npm: https://registry.npmjs.org/css-element-queries (fetched 2026-08-29T09:12:14.395206+00:00, sha 3c1bdfbfacd7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
