跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
其他技能

defaults

Applies house defaults for scroll edges, surfaces, type, sound, focus, forms, loading, hotkeys and dialogs.

raphaelsalaja · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add raphaelsalaja/skills --skill defaults

技能说明


name: defaults description: Applies house defaults for scroll edges, surfaces, type, sound, focus, forms, loading, hotkeys and dialogs.

Defaults

This skill holds the interface defaults that apply on every screen. It covers surfaces, type, sound, focus, forms, loading and overlays.

Tokens first, then these values

Use the project's token wherever one exists for a value below. Where none exists, the values here are exact. A hard scroll cut or a clipped shadow is a finding in any style.

Words and punctuation belong to copy. Building any of these with the project's primitive belongs to reuse. Whether a sound or an animation should exist at all belongs to restraint. How things move belongs to motion, and colour and contrast belong to color. Concentric radii, optical nudges and icon alignment belong to alignment.

Scroll edges fade

A scroll container fades at its ends with a mask-image gradient. A hard cut at the overflow edge is defaults-fade-not-cut. The recipe is in recipes.md.

Shadows are never cut off

Give a scroller enough padding that its children's shadows fit inside it. A shadow clipped by overflow: hidden is defaults-no-clipped-shadow. See recipes.md.

Code and tables scroll, never wrap

Code blocks and data tables scroll sideways with a hidden scrollbar. A wrapping code line is defaults-scroll-not-wrap. See recipes.md.

Overlays keep their scroll

Scrollable dialogs, drawers, menus and side panels set overscroll-behavior: contain. A modal list whose end scrolls the page behind it is defaults-contain-overscroll.

Sticky chrome keeps its edge

A sticky header or footer takes a 1px border against the content scrolling under it. A borderless sticky header is defaults-sticky-border.

Set scroll-padding-block-start to the sticky header's height, so anchors and focused fields land below it. A focused field hidden under the header is defaults-clear-sticky-chrome.

Floating surfaces take a ring, not a border

A popover, menu or card that floats pairs its shadow with a translucent 1px ring inside the shadow stack. An opaque border beside a shadow is defaults-ring-not-border. Keep border: 1px solid transparent under the ring, so forced-colours mode still draws an edge.

Shadows are layered and fall one way

Use the project's elevation token. Without one, layer three shadows with blur growing and opacity falling, all offset downward. One 0 4px 16px rgba(0, 0, 0, 0.2) is defaults-layered-shadows. See recipes.md.

To raise a surface on hover, fade in a pseudo-element that holds the raised shadow. A transition on box-shadow is defaults-fade-the-shadow. See recipes.md.

Content images take a faint outline

Photos and screenshots take a 1px outline inset by 1px, black at 10% in light mode and white at 10% in dark. A photo edge melting into its card is defaults-image-outline. Skip logos and transparent artwork. See recipes.md.

Cards never nest

A card never sits inside another card. Put the heading outside and let one surface hold the content. A card inside a card is defaults-no-nested-cards.

Rounded, not pill

Buttons and chips use the radius token. border-radius: 9999px is defaults-rounded-not-pill.

No decoration

Drop decorative gradients, glows, blur and depth effects. A glow behind a card is defaults-no-decoration.

The theme reaches the browser

A dark theme sets color-scheme: dark on the root, so scrollbars and native controls follow it. A light scrollbar on a dark page is defaults-color-scheme. Set one theme-color tag per colour scheme, matching the top of the page.

A theme switch turns transitions off for one frame. Every colour fading at once as the theme changes is defaults-quiet-theme-switch. See recipes.md.

Focus rings for the keyboard only

Use :focus-visible with outline. A ring on every click is defaults-focus-keyboard-only.

Dialogs hold focus

A dialog moves focus inside on open, keeps Tab inside and returns focus to its trigger on close. Focus left on the page behind an open dialog is defaults-trap-and-return-focus. A native <dialog> opened with showModal() handles the trap.

Targets are at least 24px

Every interactive target is at least 24px on its shorter side, and aims for 40px with a mouse and 44px on touch. When the glyph is smaller, a pseudo-element with a negative inset carries the hit area. A 16px icon button with a 16px hit box is defaults-hit-area. Extended hit areas never overlap. See recipes.md.

Controls say what they are

An icon-only button carries an aria-label that says what it does. A bare trash icon with no name is defaults-name-icon-buttons.

Status never rests on colour alone. Pair it with an icon or a word. A red dot as the only sign of an error is defaults-not-color-alone.

Links are links

Navigation uses <a href>, so new-tab clicks, middle clicks and copy link all work. A div whose onClick changes the route is defaults-links-are-links.

State lives in the URL

Filters, tabs, pagination and open panels write to the URL, so refresh, share and Back keep them. A filter lost on refresh is defaults-state-in-url.

Zoom stays on

Never set maximum-scale=1 or user-scalable=no in the viewport tag. A page that blocks pinch zoom is defaults-allow-zoom.

Taps feel native

Set -webkit-tap-highlight-color: transparent once on the root, and give every tappable element its own :active state. A grey flash on tap is defaults-no-tap-highlight.

Buttons and links set touch-action: manipulation, so a tap fires without waiting for a second tap. A tap that lands 300ms late is defaults-fast-tap. See recipes.md.

Hover styles need a hover

阅读完整来源 ↗