From afe7188b44c1bb967d801a86d2368c5932ae48c1 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 28 Nov 2023 11:53:12 -0500 Subject: [PATCH 01/29] Add implementation warning for browsers --- .../colors/ImplementationWarning.svelte | 26 +++++++++++++++++++ src/lib/components/colors/index.svelte | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 src/lib/components/colors/ImplementationWarning.svelte diff --git a/src/lib/components/colors/ImplementationWarning.svelte b/src/lib/components/colors/ImplementationWarning.svelte new file mode 100644 index 00000000..59b7d261 --- /dev/null +++ b/src/lib/components/colors/ImplementationWarning.svelte @@ -0,0 +1,26 @@ + + +{#if isUnbounded} + Browser rendering of + {spaceObject.name} for colors outside of the display gamut is incorrect + + according to the CSS specification. + +{/if} diff --git a/src/lib/components/colors/index.svelte b/src/lib/components/colors/index.svelte index e666ed02..e2f81486 100644 --- a/src/lib/components/colors/index.svelte +++ b/src/lib/components/colors/index.svelte @@ -1,6 +1,7 @@ + +
+ Known Color Issues +
+
Gamut Mapping implementation
+
+ Browsers implemented gamut mapping using clipping, which is fast but + provides inferior results to the algorithm defined in the CSS Spec. Until browsers are updated, colors that are out of gamut for your + screen may be displayed very differently than expected. +
+
+
+ + diff --git a/src/lib/components/ratio/index.svelte b/src/lib/components/ratio/index.svelte index 953f01ae..df00395e 100644 --- a/src/lib/components/ratio/index.svelte +++ b/src/lib/components/ratio/index.svelte @@ -6,6 +6,8 @@ import { RATIOS } from '$lib/constants'; import { bg, fg } from '$lib/stores'; + import ColorIssues from './ColorIssues.svelte'; + $: ratio = contrast($bg, $fg, 'WCAG21'); $: displayRatio = Math.round((ratio + Number.EPSILON) * 100) / 100; $: pass = ratio >= RATIOS.AA.Large; @@ -65,6 +67,7 @@
Bold Weight
+ diff --git a/src/lib/components/ratio/index.svelte b/src/lib/components/ratio/index.svelte index f6155f07..f9f7f501 100644 --- a/src/lib/components/ratio/index.svelte +++ b/src/lib/components/ratio/index.svelte @@ -25,8 +25,8 @@ In WCAG 2, contrast is a measure of the difference in perceived brightness between two colors, expressed as a ratio. Learn more about contrast ratio requirements. + >Learn more about contrast ratio requirements.

diff --git a/src/sass/patterns/_lists.scss b/src/sass/patterns/_lists.scss index 0cd64dc3..5e921afa 100644 --- a/src/sass/patterns/_lists.scss +++ b/src/sass/patterns/_lists.scss @@ -14,6 +14,16 @@ li { gap: var(--gutter); } +details { + --link: var(--fgcolor); + --link-focus: var(--fgcolor); + + background-color: var(--status-result-bg, var(--bgcolor)); + border-radius: var(--border-radius); + color: var(--status-result-fg, var(--fgcolor)); + padding: var(--double-gutter); +} + dl { display: grid; grid-template-columns: auto 1fr; From 13ae3bdc0a1eca46c714d1e29f844a4464a2d4ca Mon Sep 17 00:00:00 2001 From: dvdherron Date: Mon, 18 Dec 2023 14:49:17 +0100 Subject: [PATCH 15/29] relocate some styles to lists.scss --- src/lib/components/ratio/ColorIssues.svelte | 10 +--------- src/sass/patterns/_lists.scss | 9 +++++++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/lib/components/ratio/ColorIssues.svelte b/src/lib/components/ratio/ColorIssues.svelte index 0b2b9ce2..655bdee5 100644 --- a/src/lib/components/ratio/ColorIssues.svelte +++ b/src/lib/components/ratio/ColorIssues.svelte @@ -29,18 +29,10 @@ diff --git a/src/sass/patterns/_lists.scss b/src/sass/patterns/_lists.scss index 5e921afa..ebeff9f1 100644 --- a/src/sass/patterns/_lists.scss +++ b/src/sass/patterns/_lists.scss @@ -21,7 +21,12 @@ details { background-color: var(--status-result-bg, var(--bgcolor)); border-radius: var(--border-radius); color: var(--status-result-fg, var(--fgcolor)); - padding: var(--double-gutter); +} + +summary { + cursor: pointer; + list-style-position: outside; + margin-block-end: var(--gutter); } dl { @@ -31,5 +36,5 @@ dl { } dd { - margin-inline-start: var(--gutter); + margin-inline-start: var(--description-margin-inline, var(--gutter)); } From ea54c127a7537b9295ad025ed58dda8585bc31ce Mon Sep 17 00:00:00 2001 From: dvdherron Date: Mon, 18 Dec 2023 15:44:00 +0100 Subject: [PATCH 16/29] adjust grid for color issues --- src/lib/components/ratio/ColorIssues.svelte | 19 +++++++++++++++---- src/lib/components/ratio/index.svelte | 8 ++++++-- src/sass/patterns/_lists.scss | 1 - 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/lib/components/ratio/ColorIssues.svelte b/src/lib/components/ratio/ColorIssues.svelte index 655bdee5..99d53b5d 100644 --- a/src/lib/components/ratio/ColorIssues.svelte +++ b/src/lib/components/ratio/ColorIssues.svelte @@ -11,9 +11,9 @@ }); -
+
Known Color Issues -
+
Gamut Mapping Implementation

@@ -29,10 +29,21 @@

diff --git a/src/lib/components/ratio/index.svelte b/src/lib/components/ratio/index.svelte index f9f7f501..f7e68b92 100644 --- a/src/lib/components/ratio/index.svelte +++ b/src/lib/components/ratio/index.svelte @@ -79,11 +79,15 @@ gap: var(--result-layout-gap, var(--double-gutter)); grid-template: 'contrastinfo' min-content - 'status' min-content / 1fr; + 'status' min-content + 'contrastdefined' min-content + 'knownissues' min-content / 1fr; @include config.between('sm-page-break', 'lg-page-break') { --result-layout-gap: var(--gutter-plus); - grid-template: 'contrastinfo status' auto / 1fr 1fr; + grid-template: + 'contrastinfo status' auto + '... knownissues' auto / 1fr 1fr; } @include config.above('lg-page-break') { diff --git a/src/sass/patterns/_lists.scss b/src/sass/patterns/_lists.scss index ebeff9f1..987ac115 100644 --- a/src/sass/patterns/_lists.scss +++ b/src/sass/patterns/_lists.scss @@ -26,7 +26,6 @@ details { summary { cursor: pointer; list-style-position: outside; - margin-block-end: var(--gutter); } dl { From 6942eec756f1124331eb90e37ca83c3d8fd6ecbf Mon Sep 17 00:00:00 2001 From: dvdherron Date: Mon, 18 Dec 2023 15:51:18 +0100 Subject: [PATCH 17/29] alpha order --- src/lib/components/ratio/ColorIssues.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/ratio/ColorIssues.svelte b/src/lib/components/ratio/ColorIssues.svelte index 99d53b5d..be7dfa33 100644 --- a/src/lib/components/ratio/ColorIssues.svelte +++ b/src/lib/components/ratio/ColorIssues.svelte @@ -35,9 +35,9 @@ } .issues-list { display: grid; - grid-template-columns: 1fr; - grid-auto-rows: auto; gap: var(--gutter); + grid-auto-rows: auto; + grid-template-columns: 1fr; } dd { --description-margin-inline: 0; From b7777cd24bb4bc35390904fac6e69af481c0a209 Mon Sep 17 00:00:00 2001 From: dvdherron Date: Mon, 18 Dec 2023 16:09:50 +0100 Subject: [PATCH 18/29] strong to bold --- src/lib/components/ratio/ColorIssues.svelte | 8 ++++++-- src/sass/patterns/_lists.scss | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/components/ratio/ColorIssues.svelte b/src/lib/components/ratio/ColorIssues.svelte index be7dfa33..fc100ea9 100644 --- a/src/lib/components/ratio/ColorIssues.svelte +++ b/src/lib/components/ratio/ColorIssues.svelte @@ -12,9 +12,9 @@
- Known Color Issues + Known Color Issues
-
Gamut Mapping Implementation
+
Gamut Mapping Implementation

Browsers implemented gamut mapping using clipping, which is fast but @@ -39,6 +39,10 @@ grid-auto-rows: auto; grid-template-columns: 1fr; } + + dt { + font-weight: bold; + } dd { --description-margin-inline: 0; } diff --git a/src/sass/patterns/_lists.scss b/src/sass/patterns/_lists.scss index 987ac115..d23b40c7 100644 --- a/src/sass/patterns/_lists.scss +++ b/src/sass/patterns/_lists.scss @@ -25,6 +25,7 @@ details { summary { cursor: pointer; + font-weight: bold; list-style-position: outside; } From 88bac505d33a9425bb118819f7259268f88d985b Mon Sep 17 00:00:00 2001 From: dvdherron Date: Mon, 18 Dec 2023 16:22:29 +0100 Subject: [PATCH 19/29] adjust grid spacing --- src/sass/patterns/_lists.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/patterns/_lists.scss b/src/sass/patterns/_lists.scss index d23b40c7..fc1443d6 100644 --- a/src/sass/patterns/_lists.scss +++ b/src/sass/patterns/_lists.scss @@ -11,7 +11,7 @@ li { [data-list='inline'] { align-items: center; display: flex; - gap: var(--gutter); + gap: var(--shim); } details { From 2ad6e3b1c3a5ec56c41d9d485d70b8d95ca74aa7 Mon Sep 17 00:00:00 2001 From: Jonny Gerig Meyer Date: Mon, 18 Dec 2023 15:19:57 -0500 Subject: [PATCH 20/29] copy edits from stacy --- src/lib/components/ratio/ColorIssues.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/ratio/ColorIssues.svelte b/src/lib/components/ratio/ColorIssues.svelte index 55cf61e6..62b49855 100644 --- a/src/lib/components/ratio/ColorIssues.svelte +++ b/src/lib/components/ratio/ColorIssues.svelte @@ -28,10 +28,10 @@

Checking for Out of Gamut Colors

- The new color features in CSS now allow for a much wider range of - colors, many of which can not be shown on many (or any) screens. When - selecting colors, consider that most users will see these colors on a - display that supports the sRGB or P3 gamut. + The new color features in CSS allow for a much wider range of colors, + many of which cannot be shown on many (or any) screens. When selecting + colors, consider that most users will see these colors on a display that + supports the sRGB or P3 gamut.

There are two primary ways a color can be out of gamut:

    From 72e099cb82200f7bf98680625eb19eb26f6c08bf Mon Sep 17 00:00:00 2001 From: dvdherron Date: Tue, 19 Dec 2023 14:40:14 +0100 Subject: [PATCH 21/29] review edits --- src/lib/components/ratio/ColorIssues.svelte | 31 +++++++++++++++++++-- src/lib/components/ratio/index.svelte | 2 +- src/sass/config/scale/_ui.scss | 2 ++ src/sass/patterns/_lists.scss | 4 +++ src/sass/patterns/_themes.scss | 2 ++ 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/lib/components/ratio/ColorIssues.svelte b/src/lib/components/ratio/ColorIssues.svelte index fc100ea9..fb2d561e 100644 --- a/src/lib/components/ratio/ColorIssues.svelte +++ b/src/lib/components/ratio/ColorIssues.svelte @@ -31,13 +31,40 @@