cssAvoid common CSS pitfalls â stacking context, layout quirks, and underused modern features.
Install via ClawdBot CLI:
clawdbot install ivangdavila/cssUser needs CSS expertise â from layout challenges to production optimization. Agent handles stacking contexts, flexbox/grid patterns, responsive design, performance, and accessibility.
| Topic | File |
|-------|------|
| Layout patterns | layout.md |
| Responsive techniques | responsive.md |
| Selectors and specificity | selectors.md |
| Performance optimization | performance.md |
z-index only works with positioned elementsâor flex/grid childrenisolation: isolate creates stacking contextâcontains z-index chaos without positionopacity < 1, transform, filter create stacking contextâunexpected z-index behavioroverflow: hidden on flex container can breakâuse overflow: clip if you don't need scrollflex: 1 means flex: 1 1 0%âbasis is 0, not automin-width: 0 on flex child for text truncationâdefault min-width is min-contentflex-basis vs width: basis is before grow/shrinkâwidth is after, basis preferredgap works in flex nowâno more margin hacks for spacingfr units don't respect min-content aloneâuse minmax(min-content, 1fr)auto-fit vs auto-fill: fit collapses empty tracks, fill keeps themgrid-template-columns: 1fr 1fr is not 50%âit's equal share of REMAINING spacemin-width media queries, base styles for mobile@container (min-width: 400px)âcomponent-based responsivecontainer-type: inline-size on parent requiredâfor container queries to workclamp(min, preferred, max) for fluid typographyâclamp(1rem, 2.5vw, 2rem)min() and max()âwidth: min(100%, 600px) replaces media queryfit-content sizes to content up to maxâwidth: fit-content or fit-content(300px):is() for groupingâ:is(h1, h2, h3) + p less repetition:where() same as :is() but zero specificityâeasier to override:has() parent selectorâ.card:has(img) styles card containing image:focus-visible for keyboard focus onlyâno outline on mouse clickscroll-behavior: smooth on htmlânative smooth scroll for anchorsoverscroll-behavior: containâprevents scroll chaining to parent/bodyscroll-snap-type and scroll-snap-alignânative carousel without JSscrollbar-gutter: stableâreserves scrollbar space, prevents layout shiftinset: 0 equals top/right/bottom/left: 0âless repetitionplace-items is align-items + justify-itemsâplace-items: center centers bothmargin-inline, margin-block for logical propertiesârespects writing directioncontain: layout isolates repaintsâuse on independent componentscontent-visibility: auto skips offscreen renderingâhuge for long pageswill-change sparinglyâcreates layers, uses memoryprefers-reduced-motion: reduceâdisable animations for vestibular disordersprefers-color-schemeâ@media (prefers-color-scheme: dark) for dark modeforced-colors: activeâadjust for Windows high contrastGenerated Mar 1, 2026
A developer needs to create a responsive product grid that adapts to various screen sizes and maintains consistent spacing between items. The agent can provide guidance on using CSS Grid with auto-fit and minmax() for flexible columns, along with gap for spacing, ensuring proper truncation of product titles with min-width: 0 in flex children.
A team is building a navigation menu that must be keyboard-accessible and support dark mode. The agent helps implement focus-visible for keyboard-only outlines, prefers-color-scheme media queries for dark mode styling, and scroll-behavior: smooth for anchor links, enhancing usability across devices.
A dashboard with many data visualizations requires optimization to prevent layout thrash and improve rendering speed. The agent advises using contain: layout to isolate repaints, content-visibility: auto to skip offscreen elements, and will-change sparingly for animations, ensuring smooth interactions on long pages.
A developer wants to create a card component that adjusts its layout based on its container size rather than the viewport. The agent explains how to set container-type: inline-size on the parent and use @container queries for component-based responsive design, avoiding media query complexity.
A modal overlay is experiencing z-index issues where content appears behind other elements. The agent identifies stacking context traps, recommending isolation: isolate to contain z-index chaos and ensuring positioned elements or flex/grid children are used, preventing unexpected layering behavior.
Freelancers can use this skill to offer specialized CSS consulting services, such as fixing layout bugs or optimizing performance for client websites. By implementing modern techniques like container queries and accessibility features, they can deliver high-quality, maintainable code, leading to repeat business and referrals.
A SaaS company integrates this skill into their product development to improve user interface responsiveness and accessibility. By applying responsive design principles and performance optimizations, they enhance user experience, reduce bounce rates, and increase subscription renewals through better product quality.
Digital agencies adopt this skill to train their teams on modern CSS best practices, reducing development time and errors. They create internal toolkits based on the quick reference files, streamlining projects for clients in e-commerce or media, and charging premium rates for expert-driven solutions.
đŹ Integration Tip
Integrate this skill by referencing the quick reference files for specific topics during development sprints, and apply the CSS philosophy to test with extreme content for robustness.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Expert frontend design guidelines for creating beautiful, modern UIs. Use when building landing pages, dashboards, or any user interface.
Use when building UI with shadcn/ui components, Tailwind CSS layouts, form patterns with react-hook-form and zod, theming, dark mode, sidebar layouts, mobile navigation, or any shadcn component question.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when building web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Create distinctive, production-grade static sites with React, Tailwind CSS, and shadcn/ui â no mockups needed. Generates bold, memorable designs from plain text requirements with anti-AI-slop aesthetics, mobile-first responsive patterns, and single-file bundling. Use when building landing pages, marketing sites, portfolios, dashboards, or any static web UI. Supports both Vite (pure static) and Next.js (Vercel deploy) workflows.
AI skill for automated UI audits. Evaluate interfaces against proven UX principles for visual hierarchy, accessibility, cognitive load, navigation, and more. Based on Making UX Decisions by Tommy Geoco.