principle-ui-craft
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-11
- Stars
- ★ 0
- Forks
- 0
02 资源文件 1
- 参考文档agents/openai.yaml209 B
03 SKILL.md 正文
UI Craft
Most details users never consciously notice. That is the point. When a feature behaves exactly as someone assumes it should, they proceed without a second thought.
Component rules
- Buttons must feel responsive. Add
transform: scale(0.97)on:activewith a shortease-outtransition. Apply to any pressable element; keep the scale subtle (0.95-0.98). - Never animate from
scale(0). Nothing in the real world appears from nothing. Start fromscale(0.9-0.97)plusopacity: 0. - Make popovers origin-aware. Popovers, dropdowns, menus, and tooltips scale in from their trigger, not from center. Set
transform-originto the trigger. Modals are the exception: they stay centered because they are not anchored to a trigger. - Tooltips: skip delay and animation on subsequent hovers. Delay the first appearance to avoid accidental activation, then open adjacent tooltips instantly with no animation.
- Use transitions over keyframes for interruptible UI. Transitions retarget mid-animation; keyframes restart from zero.
- Use blur to mask imperfect crossfades. When two states swap and the crossfade looks off, a subtle
filter: blur(2px)during the transition blends them so the eye reads one transformation. Keep blur under 20px; heavy blur is expensive. - Animate enter states with
@starting-stylewhere supported, so entry needs no JavaScript. - Stagger group entrances with 30-80ms between items. Stagger is decorative; never block interaction while it plays.
- Asymmetric timing. Slow where the user is deciding (a hold), snappy where the system responds (release).
Performance
- Animate
transformandopacityonly. They skip layout and paint and run on the GPU. Animatingwidth,height,margin,padding, ortoptriggers all three. - Do not drive a child's transform from a CSS variable on the parent; it recalculates styles for every child. Set
transformon the element directly. - Shorthand animation properties in some libraries are not hardware-accelerated under load; use the full
transformstring.
Accessibility
- Honor
prefers-reduced-motionwith a gentler variant, not zero: keep opacity and color, drop movement. - Gate hover motion behind
@media (hover: hover) and (pointer: fine); touch fires false hovers.
Review checklist
| Issue | Fix |
|---|---|
transition: all |
Name the exact properties |
scale(0) entry |
scale(0.95) + opacity: 0 |
ease-in on UI |
ease-out or a strong custom curve |
transform-origin: center on a trigger-anchored popover |
Set it to the trigger (modals exempt) |
| Animation on a keyboard action | Remove it |
| UI duration over 300ms | Reduce to 150-250ms |
| Ungated hover motion | Add the hover and pointer media query |
| Keyframes on a rapidly-triggered element | Use transitions |
| Everything entering at once | Add a 30-80ms stagger |
04 同仓库更多 Skills
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
wayfinder
Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
unslop
Cut AI tells from any writing. Must always apply.
triage
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.