Skip to content

Commit

Permalink
Colormix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed Nov 7, 2024
1 parent 55bd674 commit b400415
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
55 changes: 55 additions & 0 deletions storybook/src/docs/components/color-palette.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,58 @@
--ams-lightness: 75%;
}
}

.ams-storybook-color-palette__swatches--color-mix {
--ams-color: var(--ams-color-primary-blue);

/* Swatches */
--ams-swatch-1: color-mix(in oklab, var(--ams-color) 100%, var(--ams-color-neutral-gray1) 0%);
--ams-swatch-2: color-mix(in oklab, var(--ams-color) 100%, var(--ams-color-neutral-gray1) 10%);
--ams-swatch-3: color-mix(in oklab, var(--ams-color) 100%, var(--ams-color-neutral-gray1) 20%);
--ams-swatch-4: color-mix(in oklab, var(--ams-color) 100%, var(--ams-color-neutral-gray1) 30%);
--ams-swatch-5: color-mix(in oklab, var(--ams-color) 100%, var(--ams-color-neutral-gray1) 40%);

.ams-storybook-color-palette__swatch:nth-of-type(1) {
background-color: var(--ams-swatch-1);
}
.ams-storybook-color-palette__swatch:nth-of-type(2) {
background-color: var(--ams-swatch-2);
}
.ams-storybook-color-palette__swatch:nth-of-type(3) {
background-color: var(--ams-swatch-3);
}
.ams-storybook-color-palette__swatch:nth-of-type(4) {
background-color: var(--ams-swatch-4);
}
.ams-storybook-color-palette__swatch:nth-of-type(5) {
background-color: var(--ams-swatch-5);
}

&.ams-storybook-color-palette--blue {
--ams-color: var(--ams-color-primary-blue);
}

&.ams-storybook-color-palette--red {
--ams-color: var(--ams-color-primary-red);
}

&.ams-storybook-color-palette--green {
--ams-color: var(--ams-color-green);
}

&.ams-storybook-color-palette--yellow {
--ams-color: var(--ams-color-yellow);
}

&.ams-storybook-color-palette--orange {
--ams-color: var(--ams-color-orange);
}

&.ams-storybook-color-palette--magenta {
--ams-color: var(--ams-color-magenta);
}

&.ams-storybook-color-palette--grey {
--ams-color: var(--ams-color-neutral-grey3);
}
}
14 changes: 14 additions & 0 deletions storybook/src/foundation/design-tokens/colour.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,17 @@ We have 8 additional colours and 3 shades of grey.
<ColorPalette.Swatches color="grey" type="hsl" />
</ColorPalette.Section>
</ColorPalette>

## Color Mix

<ColorPalette>
<ColorPalette.Section>
<ColorPalette.Swatches color="blue" type="color-mix" />
<ColorPalette.Swatches color="red" type="color-mix" />
<ColorPalette.Swatches color="green" type="color-mix" />
<ColorPalette.Swatches color="yellow" type="color-mix" />
<ColorPalette.Swatches color="orange" type="color-mix" />
<ColorPalette.Swatches color="magenta" type="color-mix" />
<ColorPalette.Swatches color="grey" type="color-mix" />
</ColorPalette.Section>
</ColorPalette>

0 comments on commit b400415

Please sign in to comment.