Tailwind CSS Container Queries
An official Tailwind CSS plugin that adds container-query utilities (@container, @lg, @xl, etc.) for Tailwind CSS v3.2+
Repository Health
Technical Analysis
This plugin brings CSS container queries to Tailwind CSS v3.2+ by adding an @container class to mark an element as a query container and a set of @xs through @7xl variant utilities to style descendants conditionally based on that container’s width, rather than the viewport’s. It mirrors Tailwind’s existing responsive-variant syntax (@lg:underline reads just like lg:underline) so teams already fluent in Tailwind’s breakpoint system can pick up container queries with almost no new syntax to learn. Named containers (@container/main paired with @lg/main:underline) let a component style itself relative to a specific named ancestor when multiple nested containers are in play, and arbitrary values (@[17.5rem]:underline) cover one-off sizes outside the default scale.
As of Tailwind CSS v4.0, container queries are supported natively in the core framework, and the maintainers explicitly note in the README that this plugin is no longer required for v4 projects. It remains relevant for the substantial number of codebases still on Tailwind v3.2+ that need container-query utilities without a full v4 migration, and the repository is kept around by Tailwind Labs primarily to support that legacy version.
What You Get
- An
@containerutility class to mark any element as a CSS container-query container - A full
@xsthrough@7xlvariant scale (20rem-80rem) mirroring Tailwind’s existing breakpoint naming - Named containers (
@container/name+@lg/name:) for targeting a specific ancestor when containers are nested - Arbitrary-value container queries (
@[17.5rem]:underline) for one-off sizes outside the default scale - An
@container-normalutility to remove container behavior from an element conditionally - Configuration prefix support consistent with a project’s existing Tailwind prefix setup
Common Use Cases
- Building reusable card/widget components that adapt their layout to their container’s width, not the page viewport
- Sidebar or panel components that need different styling when narrow versus wide, independent of overall screen size
- Design-system components meant to be dropped into varying layout contexts (dashboards, grids, modals) with consistent responsive behavior
- Bridging container-query needs on Tailwind v3.2+ projects that are not yet ready to migrate to Tailwind v4
Under The Hood
Architecture - The plugin is a single-purpose Tailwind plugin (src/index.ts, ~85 lines) that registers the @container utility class and a matchVariant-based set of @{size} variants using Tailwind’s plugin API, generating the underlying CSS @container at-rules and container-name scoping for the named-container feature. Tech Stack - TypeScript, built against the Tailwind CSS v3 plugin API (tailwindcss as a peer dependency), with Jest for testing (jest/ config, tests/index.test.ts). Code Quality - The test suite (~250 lines) exercises the generated CSS output for the base container class, each named size variant, named containers, and arbitrary-value variants, giving reasonable confidence the class-to-CSS mapping stays correct across Tailwind versions; however, the project has seen low commit activity since Tailwind v4 shipped native container-query support. API Design - The plugin deliberately reuses Tailwind’s established variant syntax (@lg: mirrors lg:) so there is effectively zero new API surface for developers already familiar with Tailwind’s responsive design system to learn.
Used by 23 apps in this directory
agenta
Developer Tools · Devops · AI Development
The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.
Bun
Developer Tools
An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.
Convoy
Developer Tools · Devops
Convoy is an open-source, cloud-native webhooks gateway that ingests events over HTTP or straight from Kafka, SQS, Google Pub/Sub, and RabbitMQ, then reliably delivers them to subscriber endpoints with signed payloads, automatic retries, circuit breaking, and JavaScript-based transformations.
Documenso
Digital Signiture
Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.
Dub
Marketing · Analytics
The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.
Langflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.
Morphik
AI Development · Search · Databases
Morphik is an AI-native ingestion and retrieval engine that lets developers store, search, and reason over visually rich documents — scanned PDFs, manuals, slides, and video — without duct-taping together OCR, an embedding model, and a vector database.
Open Scouts
AI Agents · Automation
Create automated AI scouts that continuously search the web and send email alerts when they find what you're looking for.
OpenStatus
Monitoring · Devops
Open-source status pages and uptime monitoring with global synthetic checks, monitoring-as-code, and AI agent integration via MCP.