Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/visual-button-shadow-anatomy.md
1---2title: Use Full Shadow Anatomy on Buttons3impact: HIGH4tags: visual, shadow, button, depth, gradient5---67## Use Full Shadow Anatomy on Buttons89A polished button uses six layered techniques, not just a single box-shadow.10111. **Outer cut shadow** — 0.5px dark box-shadow to "cut" the button into the surface122. **Inner ambient highlight** — 1px inset box-shadow on all sides for environmental light reflections133. **Inner top highlight** — 1px inset top highlight for the primary light source from above144. **Layered depth shadows** — At least 3 external shadows for natural lighting155. **Text drop-shadow** — Drop-shadow on text/icons for better contrast against the button background166. **Subtle gradient background** — If you can tell there's a gradient, it's too much1718**Incorrect (flat button):**1920```css21.button {22background: var(--gray-12);23color: var(--gray-1);24box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);25}26```2728**Correct (full shadow anatomy):**2930```css31.button {32background: linear-gradient(33to bottom,34color-mix(in srgb, var(--gray-12) 100%, white 4%),35var(--gray-12)36);37color: var(--gray-1);38box-shadow:390 0 0 0.5px rgba(0, 0, 0, 0.3),40inset 0 0 0 1px rgba(255, 255, 255, 0.04),41inset 0 1px 0 rgba(255, 255, 255, 0.07),420 1px 2px rgba(0, 0, 0, 0.1),430 2px 4px rgba(0, 0, 0, 0.06),440 4px 8px rgba(0, 0, 0, 0.03);45text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);46}47```4849Reference: [@PixelJanitor](https://threadreaderapp.com/thread/1623358514440859649)50