CSS

Write modern CSS with proper stacking contexts, layout patterns, responsive techniques, and performance optimization.

clawic/skills1 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: CSS
description: Write modern CSS with proper stacking contexts, layout patterns, responsive techniques, and performance optimization.
license: MIT
---

## When to Use

User needs CSS expertise — from layout challenges to production optimization. Agent handles stacking contexts, flexbox/grid patterns, responsive design, performance, and accessibility.

## Quick Reference

| Topic | File |
|-------|------|
| Layout patterns | `layout.md` |
| Responsive techniques | `responsive.md` |
| Selectors and specificity | `selectors.md` |
| Performance optimization | `performance.md` |

## CSS Philosophy

- Layout should be robust—work with any content, not just demo content
- Use modern features—they have better browser support than you think
- Prefer intrinsic sizing—let content determine size when possible
- Test with extreme content—longest names, missing images, empty states

## Stacking Context Traps

- `z-index` only works with positioned elements—or flex/grid children
- `isolation: isolate` creates stacking context—contains z-index chaos without position
- `opacity < 1`, `transform`, `filter` create stacking context—unexpected z-index behavior
- New stacking context resets z-index hierarchy—child z-index:9999 won't escape parent

## Layout Traps

- Margin collapse only vertical, only block—flex/grid children don't collapse
- `overflow: hidden` on flex container can break—use `overflow: clip` if you don't need scroll

## Flexbox Traps

- `flex: 1` means `flex: 1 1 0%`—basis is 0, not auto
- `min-width: 0` on flex child for text truncation—default min-width is min-content
- `flex-basis` vs `width`: basis is before grow/shrink—width is after, basis preferred
- `gap` works in flex now—no more margin hacks for spacing

## Grid Traps

- `fr` units don't respect min-content alone—use `minmax(min-content, 1fr)`
- `auto-fit` vs `auto-fill`: fit collapses empty tracks, fill keeps them
- `grid-template-columns: 1fr 1fr` is not 50%—it's equal share of REMAINING space
- Implicit grid tracks can surprise you—items placed outside explicit grid still appear

## Responsive Philosophy

- Start mobile-first—`min-width` media queries, base styles for mobile
- Container queries: `@container (min-width: 400px)`—component-based responsive
- `container-type: inline-size` on parent required—for container queries to work
- Test on real devices—emulators miss touch targets and real performance

## Sizing Functions

- `clamp(min, preferred, max)` for fluid typography—`clamp(1rem, 2.5vw, 2rem)`
- `min()` and `max()`—`width: min(100%, 600px)` replaces media query
- `fit-content` sizes to content up to max—`width: fit-content` or `fit-content(300px)`

## Modern Selectors

- `: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 click

## Scroll Behavior

- `scroll-behavior: smooth` on html—native smooth scroll for anchors
- `overscroll-behavior: contain`—prevents scroll chaining to parent/body
- `scroll-snap-type` and `scroll-snap-align`—native carousel without JS
- `scrollbar-gutter: stable`—reserves scrollbar space, prevents layout shift

## Shorthand Traps

- `inset: 0` equals `top/right/bottom/left: 0`—less repetition
- `place-items` is `align-items` + `justify-items`—`place-items: center` centers both
- `margin-inline`, `margin-block` for logical properties—respects writing direction

## Performance Mindset

- `contain: layout` isolates repaints—use on independent components
- `content-visibility: auto` skips offscreen rendering—huge for long pages
- `will-change` sparingly—creates layers, uses memory
- Avoid layout thrash—batch reads and writes to DOM

## Accessibility Baseline

- `prefers-reduced-motion: reduce`—disable animations for vestibular disorders
- `prefers-color-scheme`—`@media (prefers-color-scheme: dark)` for dark mode
- `forced-colors: active`—adjust for Windows high contrast
- Focus indicators must be visible—don't rely on color alone

More Performance skills

seo-audit

coreyhaines31/marketingskills

When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," or "indexing issues." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.

195.1k

competitor-profiling

coreyhaines31/marketingskills

When the user wants to research, profile, or analyze competitors from their URLs. Also use when the user mentions 'competitor profile,' 'competitor research,' 'competitor analysis,' 'profile this competitor,' 'analyze competitor,' 'competitive intelligence,' 'competitor deep dive,' 'who are my competitors,' 'competitor landscape,' 'competitor dossier,' 'competitive audit,' or 'research these competitors.' Input is a list of competitor URLs. Output is structured competitor profile markdown files. For creating comparison/alternative pages from profiles, see competitors. For sales-specific battle cards, see sales-enablement.

65.8k

prospecting

coreyhaines31/marketingskills

When the user wants to find, qualify, and build a list of prospects to reach out to — across B2B SaaS, general B2B, or local small businesses. Also use when the user mentions "prospecting," "build a prospect list," "find prospects," "find leads," "lead gen list," "find SaaS companies that," "find B2B companies," "find local businesses," "ICP-fit accounts," "who should we go after," "outbound list," "target account list," "find clients near me," "businesses without websites," "prospect research," "qualified leads," "find my first customers," "early adopters," "design partners," "beta users," or "who has this problem." Use this for the list-building and qualification phase. For writing the outbound copy after the list is built, see cold-email. For deep competitive research on specific accounts, see competitor-profiling.

42.1k

← All Performance skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY