Promoted 14 new tokens (--accent-hover, --signal-{good,bad,warn}-hover,
--accent-bright, --thumb-black, --overlay, --shadow, --ease-out-{quart,expo},
--dur-{fast,normal,slide}, --z-topbar) and substituted every raw oklch /
cubic-bezier / hardcoded z-index occurrence in the 12 primitive files.
cubic-bezier appearances dropped from 8 files to 0 (only in tokens.css).
Bundle byte count: 138 KB -> 139 KB. Visual regression: zero (smoke page
still renders identically).
73 lines
1.8 KiB
CSS
73 lines
1.8 KiB
CSS
/* button.css ─ sm/md/lg × primary/secondary/ghost/danger */
|
||
|
||
.wd-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 6px;
|
||
border-radius: 4px;
|
||
border: 1px solid transparent;
|
||
font: 500 13px/1 var(--font);
|
||
cursor: pointer;
|
||
user-select: none;
|
||
transition: background-color var(--dur-fast) var(--ease-out-quart),
|
||
border-color var(--dur-fast) var(--ease-out-quart),
|
||
color var(--dur-fast) var(--ease-out-quart);
|
||
}
|
||
.wd-btn:focus-visible {
|
||
outline: 2px solid var(--accent-subtle);
|
||
outline-offset: 1px;
|
||
}
|
||
.wd-btn:active:not(:disabled) { opacity: 0.85; transition: opacity 60ms; }
|
||
.wd-btn:disabled {
|
||
opacity: 0.4;
|
||
cursor: not-allowed;
|
||
}
|
||
.wd-btn > svg { width: 12px; height: 12px; flex-shrink: 0; }
|
||
|
||
/* Sizes */
|
||
.wd-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
|
||
.wd-btn--md { height: 32px; padding: 0 12px; font-size: 13px; }
|
||
.wd-btn--lg { height: 36px; padding: 0 14px; font-size: 13px; }
|
||
|
||
/* Variants */
|
||
.wd-btn--primary {
|
||
background: var(--accent);
|
||
color: oklch(98% 0.005 266);
|
||
}
|
||
.wd-btn--primary:hover:not(:disabled) {
|
||
background: var(--accent-hover);
|
||
}
|
||
|
||
.wd-btn--secondary {
|
||
background: var(--bg-surface);
|
||
color: var(--text-primary);
|
||
border-color: var(--border);
|
||
}
|
||
.wd-btn--secondary:hover:not(:disabled) {
|
||
background: var(--bg-hover);
|
||
border-color: var(--border-strong);
|
||
}
|
||
|
||
.wd-btn--ghost {
|
||
background: transparent;
|
||
color: var(--text-secondary);
|
||
}
|
||
.wd-btn--ghost:hover:not(:disabled) {
|
||
background: var(--bg-hover);
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.wd-btn--danger {
|
||
background: var(--signal-bad);
|
||
color: oklch(98% 0.005 25);
|
||
}
|
||
.wd-btn--danger:hover:not(:disabled) {
|
||
background: var(--signal-bad-hover);
|
||
}
|
||
|
||
/* Icon-only (28px square) */
|
||
.wd-btn--icon {
|
||
width: 28px;
|
||
padding: 0;
|
||
}
|