Skip to content

Commit

Permalink
Make gamut warning conditional, add z-index
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnw committed Feb 5, 2025
1 parent c592135 commit cdfec9a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/lib/components/colors/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@
data-needs-changes={hasError}
>
<div class="swatch {type} {colorInGamut ? 'in-gamut' : 'out-of-gamut'}">
<div class="gamut-warning">
<span class="sr-only">Out of gamut</span><Icon name="warning" />
</div>
{#if !colorInGamut}
<div class="gamut-warning">
<span class="sr-only">Out of gamut</span><Icon name="warning" />
</div>
{/if}
</div>
<label for="{type}-color" data-label>
{displayType} Color
Expand Down Expand Up @@ -143,6 +145,11 @@
outline: var(--warning) 3pt solid;
}
.gamut-warning {
z-index: 1;
position: absolute;
}
&.bg {
&:after {
background-color: var(--bgcolor);
Expand Down

0 comments on commit cdfec9a

Please sign in to comment.