Css Container Queries
Dynamically style elements based on container size using CSS Container Queries, simplifying responsive design workflows.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add css-container-queries npx -- -y @trustedskills/css-container-queries
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"css-container-queries": {
"command": "npx",
"args": [
"-y",
"@trustedskills/css-container-queries"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill allows AI agents to generate CSS using container queries. Container queries apply styles based on the size of a containing element, rather than just the viewport. This enables responsive designs that adapt to different contexts within a page, such as sidebars or custom containers.
When to use it
- Responsive components: When you need a component to adjust its layout and styling based on the width of its parent container.
- Custom layouts: For creating complex layouts where elements should behave differently depending on their surrounding context.
- Adaptive design systems: To build reusable UI components that automatically adapt to various container sizes within a larger application.
- Dynamic content areas: When designing for pages with variable content widths, ensuring consistent styling across different scenarios.
Key capabilities
- Generates CSS container queries.
- Adapts styles based on parent element size.
- Supports responsive component design.
Example prompts
- "Generate a CSS container query to make this card take up 100% width when its container is less than 600px wide, and 50% otherwise."
- "Create a container query that changes the font size of an element based on the height of its parent div."
- “Write CSS for a sidebar that collapses to a smaller width when viewed inside a narrow container.”
Tips & gotchas
- Ensure your AI agent has a good understanding of CSS syntax and responsive design principles.
- Container queries are relatively new, so browser compatibility might be a consideration for older projects.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.