css-ui
Use when writing or fixing plain CSS and HTML for a page or component. Triggers: write the CSS for, style this card, CSS dark mode, CSS sticky header covers content, CSS layout shifts, no framework, vanilla CSS, container query, napis CSS, tmavy rezim, stylovani. Builds the design source in CSS; palette roles and Tailwind are css-tokens, how to audit it is ui-audit, why the values are what they are is ui-design.
- License 许可
- GPL-3.0
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- css-ui
- description
- Use when writing or fixing plain CSS and HTML for a page or component. Triggers: write the CSS for, style this card, CSS dark mode, CSS sticky header covers content, CSS layout shifts, no framework, vanilla CSS, container query, napis CSS, tmavy rezim, stylovani. Builds the design source in CSS; palette roles and Tailwind are css-tokens, how to audit it is ui-audit, why the values are what they are is ui-design.
03 SKILL.md 正文
CSS UI
Hand-written CSS drifts the same way every time: a hex in a component, a dark theme that is the light one inverted, a hover that nudges the layout, an animation that ignores the user's motion setting. This skill is for the person who ships web UI and answers for its accessibility. Its outcome is CSS where every value traces to a token, both themes are checked, and the page is plain semantic HTML first. Out of scope: choosing the token values (ui-design: the design source is the expected column), measuring the result (ui-audit), criteria and law (a11y-audit, a11y-conformance), motion judgement (review-animations), React (react-ui).
Rules
- Semantic HTML before any class.
button,a,label,dialog,details,nav,main, a real heading order. Reason: role, name, keyboard and focus then come free; adivwith a click handler needs all four rebuilt by hand and one is always missed. - Tokens are custom properties on
:root, nothing else holds a literal. Fills come as--primaryplus--on-primary, and a component uses the pair together, never one half with a hand-picked partner. Reason: contrast is checked on the pair in each theme, so only a pair can be proven. Scales (space, type, radius, layer, duration, easing) are tokens too; az-index: 9999or200msin a component is a literal and a finding. - Each theme is its own block, designed, not derived. Light values in
:root, dark values in@media (prefers-color-scheme: dark) { :root { ... } }with the same token names. Addcolor-scheme: light darkso form controls and scrollbars follow. Borders, dividers and hover states are re-checked in dark: a1pxline that reads in light is often invisible on a dark fill (non-text contrast 3:1, WCAG 1.4.11). If the page also offers a manual toggle, put the same values under:root[data-theme="dark"]and keep one source of the values. - Focus is
:focus-visible, neveroutline: nonealone. Ring of 2 px or more, 3:1 against the adjacent colours,outline-offsetso it clears the border. Reason: removing the outline without replacing it is the commonest keyboard lock-out, and:focus-visiblekeeps the ring off mouse clicks. - No state changes layout bounds. A press is
transform: scale()on:active(animate owns it); hover (inside@media (hover: hover) and (pointer: fine)), focus and disabled change colour, opacity or shadow. No border that goes from 1 px to 2 px, no added padding or font-weight: reserve the space (outline,box-shadow, or a transparent border of the final width). Reason: bounds that move make the pointer leave the target and flicker. - Targets are at least 44 px on touch (Vercel README); 24 px is the WCAG 2.5.8 floor.
min-block-sizeandmin-inline-sizeon the control, padding for the rest; a 16 px icon button gets padding, not a bigger icon. - Motion comes from tokens, and gentles on request. Easing and duration are custom
properties, and movement has its own duration token (
--dur-move-*), separate from the opacity and colour ones (--dur-fade-*).@media (prefers-reduced-motion: reduce)sets the movement-duration tokens on:rootto0ms, replacing movement with the settled state while keeping useful opacity and colour feedback (animate). Settle state directly rather than waiting for a transition-end event at zero duration. Reason: a per-component override is forgotten in the next component. Curves,@starting-style, hover gating and the rest are web-motion's. - Layout does not shift.
aspect-ratioorwidth/heighton images and embeds, a reserved block for async content (a busy state after 1 s; thresholds: ui-design),font-display: swapwith a metric-matched fallback (size-adjust), and the critical font preloaded. Below-fold images getloading="lazy", the herofetchpriority="high"; a video replaces an animated GIF. Reason: a late image pushing a button under the pointer is a mis-click. - Size by the container and the content.
min(),max(),clamp()for fluid type and width;@container(setcontainer-type: inline-size) so a card adapts to its slot, not the viewport; full-height rules (100dvhfor a shell,100svhfor a hero, never100vh) are mobile-native's. Long user text:overflow-wrap: anywhereon a shrinkable flex or grid child, neverword-break: break-allon prose. Numbers in columns:font-variant-numeric: tabular-nums. - A sticky or fixed bar reserves its space.
scroll-padding-topequal to the header height (so anchors and focused fields are not hidden under it),padding-bottomfor a fixed footer; safe areas are mobile-native's. Reason: a focused control under a sticky header fails 2.4.11, and the user cannot see where they are. - Icons follow ui-design's icon rule. In HTML: an icon-only control has a tooltip and an
aria-label; an icon beside other text isaria-hidden="true". - Features: container queries,
dvh,:focus-visible,:has,color-schemeare Baseline and safe to use; anything newer is checked on MDN before use, and gets an@supportsfallback. The page works without it. - A surface that opens on hover is also reachable without hover. It opens on entry, closes
after the delay in ux-audit (the owner's ruling), and every action and fact in it is reachable
by click and by keyboard: a
buttonwitharia-expanded(orpopovertarget) toggles it,Escapecloses it. Reason: touch and keyboard users never hover.:focus-withinkeeps a compound control open while focus is inside. - A dark overlay follows ui-design's overlay rule. In CSS: a layered
box-shadow, and in the dark block a1pxborder whose colour token carries alpha.
Libraries
Platform first: dialog, popover, details, :has and container queries need no package.
Tailwind and the palette's role aliases are css-tokens'; the library picks are pick-ui-library's. No
CSS-in-JS runtime for a static page. Touch and phone fixes (tap highlight, dvh, safe areas, input
zoom) are mobile-native; motion is animate and review-animations.
Conventions
From the Vercel web interface guidelines, in our words:
- Modal and drawer scroll containment follows mobile-native's Overscroll rule. A dark theme
sets
color-scheme: darkonhtml, a nativeselectgets explicitbackground-colorandcolor, andtheme-colormatches the page background. - Increase contrast on
:hover,:activeand:focus, never lower it. Make focus rings clear sticky bars (rule 10), and keep a visible replacement for any removed outline. - On an overlay: layered shadows (an ambient one and a direct one) and a crisp edge from a semi-transparent border plus a shadow (rule 14); a container's edge is ui-palette's one separation mechanism, not this. Nested radii where the child is never larger than the parent, and borders and shadows tinted toward the background hue so greys do not look pasted on.
- Text:
text-wrap: balanceon headings,…not..., a non-breaking space inside10 MBand⌘ K, curly quotes,scroll-margin-topon headings, and a skip link. - Content survives short, average and very long user text, and empty, sparse, dense and error states are designed; a skeleton mirrors the final content so nothing shifts.
- Dates and numbers go through
Intl.DateTimeFormatandIntl.NumberFormat, never a hard-coded format; language comes fromAccept-Languageornavigator.languages, not the IP. Meaningful media has captions or a transcript, and its controls work from the keyboard. - Brand names and code tokens get
translate="no";user-scalable=noandmaximum-scale=1are never set, because they block zoom. - If it looks clickable it is clickable; the label and its checkbox or radio share one hit target with no dead zone; a tooltip is the last resort after inline help.
- Performance:
content-visibility: autofor static rows, flex or grid before measuring in JS,<link rel="preconnect">for asset hosts. - Verify at phone, laptop and ultra-wide widths (50% zoom simulates the last), and with CPU throttling before claiming performance.
Materials
The material rules are apple-design's. In CSS: backdrop-filter: blur() with saturation on a
semi-transparent fill, @media (prefers-reduced-transparency: reduce) swapping in the solid fill
and dropping the blur, @media (prefers-contrast: more) adding a border. Letter-spacing is in em
per heading step, spacing in rem.
Make it checkable
The audits measure what the page exposes. Give them three reads: the DOM dump
(document.documentElement.outerHTML), the accessibility-tree dump (role, name, state per node;
a test driver's accessibility snapshot or the browser's accessibility pane), and
getComputedStyle(el) for colour, size and bounds per state. These are the introspection surface
for ui-audit and a11y-audit; a UI that cannot be read this way is reported as not measured.
Red flags
transition: all: name the properties, because layout properties will animate and shift.100vh, or aposition: fixedheader with noscroll-padding: fix per mobile-native and rule 10, because the mobile address bar and the sticky header both hide content.- A hover that sets
width,border-width,margin,padding, orfont-weight: move to a non-layout property, because the target moves under the pointer.
Say it in the reply
Start with which tokens exist and which were added, then the two themes and the pair ratios you checked or could not measure ("not measured: no browser here"; ui-audit measures it). List the states and what bounds they hold. Say which rules from the design source you could not apply because it was absent, and which you assumed. Never claim a contrast ratio you did not compute.
Sources: see the README.
04 同仓库更多 Skills
worktrunk
Use when working with git worktrees or wt (worktrunk): creating, switching, merging or removing a branch workspace, configuring wt (project or personal config, workflow hooks around switch, commit and merge, commit-message generation, hook approvals), or a wt command that failed. Triggers: make a worktree for this branch, wt merge, wt remove, configure wt, .config/wt.toml, run tests before merge, install deps when a worktree is created, wt hook, wt switch does not cd, nastav wt, wt nefunguje.
web-ladder
Use when a task needs something the internet holds: look something up, search the web, find which page answers a question, read a page, check a library's current docs, a page that needs a browser or shows a captcha. Runs one research loop: searxng search, keywords, cases, search again up to three times, Context7 for a library, Tavily when the keywords will not come, one page in a browser, the person on a wall. Triggers: look this up, search the web, find out online, read this page, check the docs, the page is blocked, captcha, najdi na webu, otevri tu stranku. A multi-round question goes to the qsm-web:web-research agent; one tool's commands are its own skill (searxng, browserbox, opensrc).
searxng
Use when running a web search through the person's own SearXNG instance with qsm-web searxng: choosing a search profile or engines, the instance, time range or language, reading its JSON, a suspended engine. Triggers: search with searxng, qsm-web searxng, search profile, niche search, academic search, IT search, vyhledavaci profil, searxng is down, which engines. The research loop around it is the web-ladder skill.
opensrc
Use when the source code of an open-source library or repository is needed on disk to read: the docs are silent, the behaviour must be checked in code, the version the project pins. Runs qsm-web opensrc get with a package spec or a repository address. Triggers: get the source of this package, clone this library, read the library's code, qsm-web opensrc, stahni zdrojak knihovny. Library docs are the Context7 skill; the research loop is the web-ladder skill.
browserbox
Use when one page needs a real browser through qsm-web browserbox: content built by script, a page that blocks plain fetching, a captcha to solve or hand to the person, a scripted sequence of clicks, a login the person is present for. Triggers: open it in a browser, the page is empty without JavaScript, captcha, take over the browser, run these steps on the page, log in to this site, browserbox. When to reach for a browser at all is the web-ladder skill.
usage
Use when the user wants a review of how they use Claude Code, or setup hands over after a first install: review my Claude Code usage, audit my setup, what does my setup cost, where did my tokens go, clean up my Claude Code, usage report, zkontroluj moje pouzivani. One walkthrough of four stages (machine, work, habits, extensions), questions after each, then one plan. A question about one topic (which hooks are slow) goes to that topic's skill; this session's tokens alone is `/qsm-usage`.