From ddfb01052f21b684a7ed655ca81f9d0ac310d7c1 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Thu, 26 Oct 2023 13:44:16 +0000 Subject: [PATCH 01/16] Group formats --- src/lib/components/colors/FormatGroup.svelte | 38 ++++++++++++++++++++ src/lib/components/colors/Formats.svelte | 26 +++++++++++--- src/lib/components/colors/Output.svelte | 12 +------ src/lib/constants.ts | 6 ++++ 4 files changed, 66 insertions(+), 16 deletions(-) create mode 100644 src/lib/components/colors/FormatGroup.svelte diff --git a/src/lib/components/colors/FormatGroup.svelte b/src/lib/components/colors/FormatGroup.svelte new file mode 100644 index 00000000..f3dca99e --- /dev/null +++ b/src/lib/components/colors/FormatGroup.svelte @@ -0,0 +1,38 @@ + + +
+
{name}
+ {#if !isInGamut} + Selected color is outside the {targetColor.space.name} gamut. + {/if} + {#each formats as format (format)} + + {/each} +
+ + diff --git a/src/lib/components/colors/Formats.svelte b/src/lib/components/colors/Formats.svelte index ef706db6..e39ce764 100644 --- a/src/lib/components/colors/Formats.svelte +++ b/src/lib/components/colors/Formats.svelte @@ -1,22 +1,38 @@

{displayType} Color

- {#each otherFormats as format (format)} - + {#each Object.entries(otherFormats) as [name, formats]} + {/each}
diff --git a/src/lib/components/colors/Output.svelte b/src/lib/components/colors/Output.svelte index 6a906f44..a2d62995 100644 --- a/src/lib/components/colors/Output.svelte +++ b/src/lib/components/colors/Output.svelte @@ -1,5 +1,5 @@ diff --git a/src/sass/initial/_type.scss b/src/sass/initial/_type.scss index f3f42728..7f8f7781 100644 --- a/src/sass/initial/_type.scss +++ b/src/sass/initial/_type.scss @@ -22,8 +22,7 @@ h1, h2, -h3, -h4 { +h3 { font-weight: normal; margin: 0; } @@ -49,7 +48,7 @@ h4 { .section-heading { @include heading; - --label-margin-bottom: var(--gutter-plus); + --label-margin-bottom: var(--gutter); @include config.below('sm-page-break') { --heading-size: var(--medium); From b3cbf677a9f6ce5b9098ab19ee14e067b1901ec3 Mon Sep 17 00:00:00 2001 From: Stacy Kvernmo Date: Mon, 13 Nov 2023 09:59:08 -0600 Subject: [PATCH 12/16] capitalization from source since sRGB should have lowercase "s" --- src/lib/constants.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 1c925524..592d4b42 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -33,14 +33,14 @@ export type FormatGroup = { export const FORMAT_GROUPS: FormatGroup[] = [ { - name: 'sRGB Formats', + name: 'sRGB FORMATS', formats: ['hex', 'hsl', 'srgb'], gamutFormat: 'srgb', gamutName: 'sRGB', }, - { name: 'Unbounded Spaces', formats: ['lab', 'lch', 'oklab', 'oklch'] }, + { name: 'UNBOUNDED SPACES', formats: ['lab', 'lch', 'oklab', 'oklch'] }, { - name: 'Display p3 Space', + name: 'DISPLAY P3 SPACE', formats: ['p3'], gamutFormat: 'p3', gamutName: 'p3', From d999b997e27125609954ba16cf2b38f31aa05616 Mon Sep 17 00:00:00 2001 From: Jonny Gerig Meyer Date: Mon, 13 Nov 2023 11:24:00 -0500 Subject: [PATCH 13/16] capitalize P3 --- src/lib/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 592d4b42..4bb8aea8 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -43,7 +43,7 @@ export const FORMAT_GROUPS: FormatGroup[] = [ name: 'DISPLAY P3 SPACE', formats: ['p3'], gamutFormat: 'p3', - gamutName: 'p3', + gamutName: 'P3', }, ]; From 8bd1ceffec0eb3a1fc2441855b265dd957cf9ff4 Mon Sep 17 00:00:00 2001 From: Stacy Kvernmo Date: Mon, 13 Nov 2023 10:12:52 -0600 Subject: [PATCH 14/16] use logical properties --- src/lib/components/colors/Formats.svelte | 2 +- src/lib/components/colors/Header.svelte | 2 +- src/lib/components/colors/Sliders.svelte | 2 +- src/sass/initial/_type.scss | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/components/colors/Formats.svelte b/src/lib/components/colors/Formats.svelte index 320e93d4..a19ab637 100644 --- a/src/lib/components/colors/Formats.svelte +++ b/src/lib/components/colors/Formats.svelte @@ -42,6 +42,6 @@ } .small-only { - margin-block-end: var(--gutter); + --label-margin-block-end: var(--gutter); } diff --git a/src/lib/components/colors/Header.svelte b/src/lib/components/colors/Header.svelte index 3d96363f..407c2fd3 100644 --- a/src/lib/components/colors/Header.svelte +++ b/src/lib/components/colors/Header.svelte @@ -165,7 +165,7 @@ } [data-label] { - --label-margin-bottom: var(--half-shim); + --label-margin-block-end: var(--half-shim); grid-area: label; } diff --git a/src/lib/components/colors/Sliders.svelte b/src/lib/components/colors/Sliders.svelte index 2e1e98d5..9afa1d5c 100644 --- a/src/lib/components/colors/Sliders.svelte +++ b/src/lib/components/colors/Sliders.svelte @@ -103,7 +103,7 @@ } [data-group~='sliders'] { - --label-margin-bottom: var(--half-shim); + --label-margin-block-end: var(--half-shim); margin-bottom: var(--triple-gutter); } diff --git a/src/sass/initial/_type.scss b/src/sass/initial/_type.scss index 7f8f7781..cfe5b2f7 100644 --- a/src/sass/initial/_type.scss +++ b/src/sass/initial/_type.scss @@ -41,14 +41,14 @@ h3 { display: block; font-size: var(--heading-size, var(--label-size)); letter-spacing: var(--heading-letterspacing, 0.05rem); - margin-bottom: var(--label-margin-bottom, 0); + margin-block-end: var(--label-margin-block-end, 0); text-transform: var(--heading-transform, uppercase); } .section-heading { @include heading; - --label-margin-bottom: var(--gutter); + --label-margin-block-end: var(--gutter); @include config.below('sm-page-break') { --heading-size: var(--medium); From 8be40b01d2cc0e218bc65338d12110b45133274d Mon Sep 17 00:00:00 2001 From: Stacy Kvernmo Date: Tue, 21 Nov 2023 15:47:48 -0600 Subject: [PATCH 15/16] Add flex container to section headers and errors --- src/lib/components/colors/FormatGroup.svelte | 28 +++++++++++++------- src/sass/initial/_type.scss | 2 -- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/lib/components/colors/FormatGroup.svelte b/src/lib/components/colors/FormatGroup.svelte index 3f03843b..435feb72 100644 --- a/src/lib/components/colors/FormatGroup.svelte +++ b/src/lib/components/colors/FormatGroup.svelte @@ -24,15 +24,17 @@
-

{formatGroup.name}

- {#if !isInGamut} - Selected color is outside the {formatGroup.gamutName} gamut. - {/if} +
+

{formatGroup.name}

+ {#if !isInGamut} + Selected color is outside the {formatGroup.gamutName} gamut. + {/if} +
{#each formatGroup.formats as format (format)} {/each} @@ -47,4 +49,12 @@ grid-template-columns: auto 1fr; margin-block-end: var(--double-gutter); } + + .format-group-heading { + align-items: baseline; + display: flex; + flex-wrap: wrap; + gap: var(--shim); + margin-block-end: var(--gutter); + } diff --git a/src/sass/initial/_type.scss b/src/sass/initial/_type.scss index cfe5b2f7..baab320a 100644 --- a/src/sass/initial/_type.scss +++ b/src/sass/initial/_type.scss @@ -48,8 +48,6 @@ h3 { .section-heading { @include heading; - --label-margin-block-end: var(--gutter); - @include config.below('sm-page-break') { --heading-size: var(--medium); } From 8b130b1374a4394016de38c3d551a172a7842d0b Mon Sep 17 00:00:00 2001 From: Stacy Kvernmo Date: Mon, 18 Dec 2023 22:13:59 -0600 Subject: [PATCH 16/16] remove unused grid --- src/lib/components/colors/FormatGroup.svelte | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lib/components/colors/FormatGroup.svelte b/src/lib/components/colors/FormatGroup.svelte index 435feb72..28fb4c82 100644 --- a/src/lib/components/colors/FormatGroup.svelte +++ b/src/lib/components/colors/FormatGroup.svelte @@ -44,9 +44,6 @@ [data-content~='format-group'] { --heading-transform: none; - column-gap: var(--gutter); - display: grid; - grid-template-columns: auto 1fr; margin-block-end: var(--double-gutter); }