Commit c729591
authored
docs(skill): say what the reset leaves alone, and how a token takes alpha (#671)
Two things readers worked out the hard way, both from the same project.
`@devup-ui/reset-css` is a normalize, not a preflight, and for form controls it
does exactly two things: `margin: 0`, and `-webkit-appearance: button` — which
*preserves* the native control appearance rather than removing it. Button
`padding`, `border` and `appearance` are deliberately untouched, so a button
still carries the UA defaults.
That is invisible until a button is sized in design units. Because
`box-sizing: border-box` is global, an explicit `8px` width cannot shrink below
the `6 + 6 + 2 + 2 = 16px` that Chrome's default `padding: 1px 6px` and
`border: 2px outset` already occupy, and an 8x8 button from a design renders
16x8. Nothing is broken and no token is wrong; the reset never claimed those
properties. The section now says so and shows the call-site fix.
The other is alpha. A token *is* a CSS custom property, which the `$token
Scope` section already says two paragraphs above — so a token at partial
opacity is `color-mix()` over `var(--token)`, with no alpha token to define and
no hardcoded copy of the colour to keep in sync. Not knowing that, a screen
hardcoded `#F7F3EC66` beside a `$bg` that was already the same colour. That is
not merely redundant: `$bg` follows the active theme and the literal does not,
so the surface stays light in dark mode. `opacity` is not a substitute either,
since it fades the element together with everything inside it while
`color-mix()` fades only the paint.1 parent 1020168 commit c729591
1 file changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
509 | 537 | | |
510 | 538 | | |
511 | 539 | | |
| |||
570 | 598 | | |
571 | 599 | | |
572 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
573 | 620 | | |
574 | 621 | | |
575 | 622 | | |
| |||
0 commit comments