Follow-up to 8515f5e6 — that commit had the stacking inverted.
The bug
-------
I put the checker on `::before { z-index: -1 }` and expected the soma's
inline `background-color` to paint on top. But within a stacking context
(my parent has `isolation: isolate`), `::before { z-index: -1 }` lands
in layer 2 — ABOVE the parent's own background (layer 1). So the
checker still covered the colour and the user only saw transparency.
The fix
-------
Inverted the layering — back to the same pattern the trigger swatch
already uses:
- Parent `[data-color-picker-value-swatch]` carries the **checker** as
its own `background-image` (sits at layer 1 of the stacking context).
- `::before` (positioned descendant, layer 2 ABOVE layer 1) paints the
**colour** via `var(--cp-current-color, transparent)`. The soma
emits `--cp-current-color: <hex>` inline as part of the swatch style.
- Where the colour has alpha < 1 (rgba), the checker shows through
the `::before` because semitransparent colour over the checker is
the standard pattern.
Default brand colour (opaque blue) now renders as a solid blue square
again; semitransparent colours show the checker behind. Checks:
67/67 component-audit PASS, svelte-check 0 errors / 0 warnings.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
active-uix
parent
8515f5e673
commit
cae638c993
Loading…
Reference in new issue