|
| 1 | +/* color themes for dark and light modes, generated with Leonardo. |
| 2 | + * Light: https://leonardocolor.io/theme.html?name=Light&config=%7B%22baseScale%22%3A%22Gray%22%2C%22colorScales%22%3A%5B%7B%22name%22%3A%22Gray%22%2C%22colorKeys%22%3A%5B%22%23000000%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Purple%22%2C%22colorKeys%22%3A%5B%22%235e30eb%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Red%22%2C%22colorKeys%22%3A%5B%22%23e32400%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%5D%2C%22lightness%22%3A98%2C%22contrast%22%3A1%2C%22saturation%22%3A100%2C%22formula%22%3A%22wcag2%22%7D */ |
| 3 | +:root { |
| 4 | + --background-color: #f8f8f8; |
| 5 | + --gray-50: #ffffff; |
| 6 | + --gray-100: #d0d0d0; |
| 7 | + --gray-200: #afafaf; |
| 8 | + --gray-300: #8f8f8f; |
| 9 | + --gray-400: #717171; |
| 10 | + --gray-500: #555555; |
| 11 | + --gray-600: #393939; |
| 12 | + --purple-100: #d5c9fa; |
| 13 | + --purple-200: #b8a3f6; |
| 14 | + --purple-300: #997cf2; |
| 15 | + --purple-400: #7a54ef; |
| 16 | + --purple-500: #582ddc; |
| 17 | + --purple-600: #3c1e95; |
| 18 | + --red-100: #f7c4ba; |
| 19 | + --red-200: #f29887; |
| 20 | + --red-300: #eb664d; |
| 21 | + --red-400: #de2300; |
| 22 | + --red-500: #a81b00; |
| 23 | + --red-600: #731200; |
| 24 | + --highlight-hover: rgb(0 0 0 / 0.07); |
| 25 | + --highlight-pressed: rgb(0 0 0 / 0.15); |
| 26 | +} |
| 27 | + |
| 28 | +/* Dark: https://leonardocolor.io/theme.html?name=Dark&config=%7B%22baseScale%22%3A%22Gray%22%2C%22colorScales%22%3A%5B%7B%22name%22%3A%22Gray%22%2C%22colorKeys%22%3A%5B%22%23000000%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Purple%22%2C%22colorKeys%22%3A%5B%22%235e30eb%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Red%22%2C%22colorKeys%22%3A%5B%22%23e32400%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%5D%2C%22lightness%22%3A11%2C%22contrast%22%3A1%2C%22saturation%22%3A100%2C%22formula%22%3A%22wcag2%22%7D */ |
| 29 | +@media (prefers-color-scheme: dark) { |
| 30 | + :root { |
| 31 | + --background-color: #1d1d1d; |
| 32 | + --gray-50: #101010; |
| 33 | + --gray-100: #393939; |
| 34 | + --gray-200: #4f4f4f; |
| 35 | + --gray-300: #686868; |
| 36 | + --gray-400: #848484; |
| 37 | + --gray-500: #a7a7a7; |
| 38 | + --gray-600: #cfcfcf; |
| 39 | + --purple-100: #3c1e95; |
| 40 | + --purple-200: #522acd; |
| 41 | + --purple-300: #6f46ed; |
| 42 | + --purple-400: #8e6ef1; |
| 43 | + --purple-500: #b099f5; |
| 44 | + --purple-600: #d5c8fa; |
| 45 | + --red-100: #721200; |
| 46 | + --red-200: #9c1900; |
| 47 | + --red-300: #cc2000; |
| 48 | + --red-400: #e95034; |
| 49 | + --red-500: #f08c79; |
| 50 | + --red-600: #f7c3ba; |
| 51 | + --highlight-hover: rgb(255 255 255 / 0.1); |
| 52 | + --highlight-pressed: rgb(255 255 255 / 0.2); |
| 53 | + } |
| 54 | +} |
| 55 | + |
| 56 | +/* Semantic colors */ |
| 57 | +:root { |
| 58 | + --focus-ring-color: var(--purple-400); |
| 59 | + --text-color: var(--gray-600); |
| 60 | + --text-color-base: var(--gray-500); |
| 61 | + --text-color-hover: var(--gray-600); |
| 62 | + --text-color-disabled: var(--gray-200); |
| 63 | + --text-color-placeholder: var(--gray-400); |
| 64 | + --link-color: var(--purple-500); |
| 65 | + --link-color-secondary: var(--gray-500); |
| 66 | + --link-color-pressed: var(--purple-600); |
| 67 | + --border-color: var(--gray-300); |
| 68 | + --border-color-hover: var(--gray-400); |
| 69 | + --border-color-pressed: var(--gray-400); |
| 70 | + --border-color-disabled: var(--gray-100); |
| 71 | + --field-background: var(--gray-50); |
| 72 | + --field-text-color: var(--gray-600); |
| 73 | + --overlay-background: var(--gray-50); |
| 74 | + --button-background: var(--gray-50); |
| 75 | + --button-background-pressed: var(--background-color); |
| 76 | + /* these colors are the same between light and dark themes |
| 77 | + * to ensure contrast with the foreground color */ |
| 78 | + --highlight-background: #6f46ed; /* purple-300 from dark theme, 3.03:1 against background-color */ |
| 79 | + --highlight-background-pressed: #522acd; /* purple-200 from dark theme */ |
| 80 | + --highlight-background-invalid: #cc2000; /* red-300 from dark theme */ |
| 81 | + --highlight-foreground: white; /* 5.56:1 against highlight-background */ |
| 82 | + --highlight-foreground-pressed: #ddd; |
| 83 | + --highlight-overlay: rgb(from #6f46ed r g b / 15%); |
| 84 | + --invalid-color: var(--red-400); |
| 85 | + --invalid-color-pressed: var(--red-500); |
| 86 | +} |
| 87 | + |
| 88 | +/* Windows high contrast mode overrides */ |
| 89 | +@media (forced-colors: active) { |
| 90 | + :root { |
| 91 | + --background-color: Canvas; |
| 92 | + --focus-ring-color: Highlight; |
| 93 | + --text-color: ButtonText; |
| 94 | + --text-color-base: ButtonText; |
| 95 | + --text-color-hover: ButtonText; |
| 96 | + --text-color-disabled: GrayText; |
| 97 | + --text-color-placeholder: ButtonText; |
| 98 | + --link-color: LinkText; |
| 99 | + --link-color-secondary: LinkText; |
| 100 | + --link-color-pressed: LinkText; |
| 101 | + --border-color: ButtonBorder; |
| 102 | + --border-color-hover: ButtonBorder; |
| 103 | + --border-color-pressed: ButtonBorder; |
| 104 | + --border-color-disabled: GrayText; |
| 105 | + --field-background: Field; |
| 106 | + --field-text-color: FieldText; |
| 107 | + --overlay-background: Canvas; |
| 108 | + --button-background: ButtonFace; |
| 109 | + --button-background-pressed: ButtonFace; |
| 110 | + --highlight-background: Highlight; |
| 111 | + --highlight-background-pressed: Highlight; |
| 112 | + --highlight-background-invalid: LinkText; |
| 113 | + --highlight-foreground: HighlightText; |
| 114 | + --highlight-foreground-pressed: HighlightText; |
| 115 | + --invalid-color: LinkText; |
| 116 | + --invalid-color-pressed: LinkText; |
| 117 | + } |
| 118 | +} |
0 commit comments