diff --git a/src/app.css b/src/app.css deleted file mode 100644 index b87aec7..0000000 --- a/src/app.css +++ /dev/null @@ -1,80 +0,0 @@ -:root { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-text-size-adjust: 100%; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -.card { - padding: 2em; -} - -#app { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} diff --git a/src/assets/green_check.svg b/src/assets/green_check.svg new file mode 100644 index 0000000..c583b6c --- /dev/null +++ b/src/assets/green_check.svg @@ -0,0 +1,4 @@ + diff --git a/src/assets/red_cross.svg b/src/assets/red_cross.svg new file mode 100644 index 0000000..f5f42a4 --- /dev/null +++ b/src/assets/red_cross.svg @@ -0,0 +1,5 @@ + diff --git a/src/pages/Contrast.svelte b/src/pages/Contrast.svelte index 8780d7f..8bc6744 100644 --- a/src/pages/Contrast.svelte +++ b/src/pages/Contrast.svelte @@ -73,23 +73,36 @@
This is primarily a tool for the Warp team to check the contrast between the various text colours and background colours. Currently only for FINN - colours. - - The colour contrast for small and normal text must be minimun 4.5 : 1. + colours. The colour contrast for small and normal text must be minimun 4.5 : 1.
+ + {#if backgroundTokens.length === 0}No background colours loaded
{:else} {#each backgroundTokens as background (background.name)}{background.colorName}, {background.value}
+{background.colorName}
Text colour name | Colour | Example | Contrast | -Usage | +Accessible | ||
---|---|---|---|---|---|---|---|
{token.name} | +
+ {token.name} + |
-
-
+
-
-
-
- {token.colorName} + class="w-24 h-24 mr-8 rounded-2" + style="background-color: {token.value};" + /> +{token.colorName} |
-
ABC abc +ABC abc |
- + |
+ {checkColors(token.value, background.value).contrast} : 1 + |
-
-
-
- {#if parseFloat(checkColors(token.value, background.value).contrast) > 4.5}
-
-
- {:else}
- OK -
-
- {/if}
+
+ Not OK - |
+
+ {#if parseFloat(checkColors(token.value, background.value).contrast) > 4.5}
+ |