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.name}

-
+
-

{background.colorName}, {background.value}

+

{background.colorName}

@@ -98,16 +111,17 @@ {:else} + - + - + @@ -116,49 +130,50 @@ {#each foregroundTokens as token (token.name)} - + - - - - {/each} @@ -180,7 +195,7 @@ main { padding: 16px; margin: auto; - max-width: 700px; + max-width: 900px; height: 100%; display: flex; flex-direction: column; @@ -191,10 +206,46 @@ } table { - margin-left: -24px; /* Adjust to match your border-spacing value */ + /* margin-left: -24px; Adjust to match your border-spacing value */ + } + + td, + th { + padding-right: 24px; /* Space to the right of the cell content */ + padding-left: 24px; /* Space to the right of the cell content */ + padding-top: 12px; + padding-bottom: 12px; + vertical-align: middle; + } + + tr { + border-bottom: 1px solid #000; + border-color: var(--w-s-color-border); + padding-top: 12px; + padding-bottom: 12px; + } + + tr:last-child { + border-bottom: none; } - td:first-child { + td:first-child, + th:first-child { padding-left: 0; } + + td:last-child, + th:last-child { + padding-right: 0; + } + + input[type="checkbox"] { + width: 16px; + height: 16px; + } + + input[type="checkbox"], +label { + vertical-align: middle; +}
Text colour name Colour Example ContrastUsageAccessible
{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} -
-

OK

-
- {:else} -
-

Not OK

-
- {/if} + +
+ + {#if parseFloat(checkColors(token.value, background.value).contrast) > 4.5} + Green check + {:else} + Red cross + {/if}