From 43cd48acb5fddb5f0ccf7c632cd4d992481a59b1 Mon Sep 17 00:00:00 2001 From: a Date: Fri, 14 Aug 2020 10:55:22 +0200 Subject: [PATCH] Start working on a color scheme --- src/frontend/color_scheme.scss | 49 +++++++++++++++++++ src/frontend/content_script/Translated.svelte | 7 +++ src/frontend/popup/LanguageSelection.svelte | 31 +++++++++--- src/frontend/popup/Popup.svelte | 46 +++++++++++------ 4 files changed, 110 insertions(+), 23 deletions(-) create mode 100644 src/frontend/color_scheme.scss diff --git a/src/frontend/color_scheme.scss b/src/frontend/color_scheme.scss new file mode 100644 index 0000000..404b6d5 --- /dev/null +++ b/src/frontend/color_scheme.scss @@ -0,0 +1,49 @@ +@use "sass:color"; + +// https://coolors.co/25a35a-3c91e6-f50000-f2f4ff-e9ce2c +$text-color-light: rgba(7, 59, 58, 1); +$background-color-light: white; + +$green: hsla(145, 63%, 39%, 1); +$blue: hsla(210, 77%, 57%, 1); +$red: hsla(0, 100%, 48%, 1); +$yellow: hsla(51, 81%, 54%, 1); + +$background-color-dark: hsla(222, 19%, 27%, 1); +$text-color-dark: hsla(60, 15%, 95%, 1); + +:root { + @for $i from 0 to 3 { + --background-color-#{$i+1}: #{color.scale( + $background-color-light, + $lightness: -$i * 5% + )}; + --text-color-#{$i+1}: #{color.scale( + $text-color-light, + $lightness: $i * 10% + )}; + + --green-#{$i+1}: #{color.scale($green, $lightness: -$i * 10%)}; + --red-#{$i+1}: #{color.scale($red, $lightness: -$i * 10%)}; + } + + --blue: #{$blue}; + --yellow: #{$yellow}; + + @media (prefers-color-scheme: dark) { + @for $i from 0 to 3 { + --background-color-#{$i+1}: #{color.scale( + $background-color-dark, + $lightness: $i * 10% + )}; + --text-color-#{$i+1}: #{color.scale( + $text-color-dark, + $lightness: -$i * 10% + )}; + } + } +} + +* { + color: var(--text-color-1); +} diff --git a/src/frontend/content_script/Translated.svelte b/src/frontend/content_script/Translated.svelte index 4178498..3c3b13a 100644 --- a/src/frontend/content_script/Translated.svelte +++ b/src/frontend/content_script/Translated.svelte @@ -16,6 +16,13 @@ + +
+