Open platform to collect and prioritize feedback
Dark mode! (#1292)
Matt Robertsb5766348a93b
diff --git a/app/pkg/web/testdata/basic.html b/app/pkg/web/testdata/basic.htmlindex 98ae6191e..e7515d16b 100755--- a/app/pkg/web/testdata/basic.html+++ b/app/pkg/web/testdata/basic.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/app/pkg/web/testdata/canonical.html b/app/pkg/web/testdata/canonical.htmlindex 5d52faee9..70ea56496 100755--- a/app/pkg/web/testdata/canonical.html+++ b/app/pkg/web/testdata/canonical.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/app/pkg/web/testdata/chunk.html b/app/pkg/web/testdata/chunk.htmlindex bf893eaf1..ffa7605e9 100644--- a/app/pkg/web/testdata/chunk.html+++ b/app/pkg/web/testdata/chunk.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/app/pkg/web/testdata/home.html b/app/pkg/web/testdata/home.htmlindex 8cdc49f56..256a3f205 100755--- a/app/pkg/web/testdata/home.html+++ b/app/pkg/web/testdata/home.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/app/pkg/web/testdata/home_ssr.html b/app/pkg/web/testdata/home_ssr.htmlindex 1a16c2a68..b88554206 100755--- a/app/pkg/web/testdata/home_ssr.html+++ b/app/pkg/web/testdata/home_ssr.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/app/pkg/web/testdata/oauth.html b/app/pkg/web/testdata/oauth.htmlindex 7d9713aeb..2d5e8bd20 100755--- a/app/pkg/web/testdata/oauth.html+++ b/app/pkg/web/testdata/oauth.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/app/pkg/web/testdata/tenant.html b/app/pkg/web/testdata/tenant.htmlindex 9c87fac08..135d288a7 100755--- a/app/pkg/web/testdata/tenant.html+++ b/app/pkg/web/testdata/tenant.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/app/pkg/web/testdata/user.html b/app/pkg/web/testdata/user.htmlindex 99b571dd9..5fa9c669b 100755--- a/app/pkg/web/testdata/user.html+++ b/app/pkg/web/testdata/user.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="en">+<html lang="en" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">diff --git a/public/assets/images/heroicons-moon.svg b/public/assets/images/heroicons-moon.svgnew file mode 100644index 000000000..84afb8919--- /dev/null+++ b/public/assets/images/heroicons-moon.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">+ <path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z" />+</svg>diff --git a/public/assets/images/heroicons-sun.svg b/public/assets/images/heroicons-sun.svgnew file mode 100644index 000000000..f442ce0d6--- /dev/null+++ b/public/assets/images/heroicons-sun.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z" />+</svg>diff --git a/public/assets/styles/reset.scss b/public/assets/styles/reset.scssindex 0edaefbe3..a9d5c25df 100644--- a/public/assets/styles/reset.scss+++ b/public/assets/styles/reset.scss@@ -15,12 +15,17 @@ body {padding: 0px;overflow-x: hidden;min-width: 320px;- color: get("colors.gray.800");- background-color: get("colors.gray.100");++ color: var(--colors-gray-800);+ background-color: var(--colors-gray-100);font-size: get("font.size.base");font-family: $font-base;}+body.dark-theme {+ color: var(--colors-gray-900);+}+code {font-family: $font-code;}@@ -51,7 +56,7 @@ textarea {}a {- color: get("colors.gray.900");+ color: var(--colors-gray-900);text-decoration: none;}diff --git a/public/assets/styles/tooltip.scss b/public/assets/styles/tooltip.scssindex 7348e5032..1c4cdfe79 100644--- a/public/assets/styles/tooltip.scss+++ b/public/assets/styles/tooltip.scss@@ -2,8 +2,8 @@position: relative;&::before {- background-color: get("colors.gray.700");- color: get("colors.white");+ background-color: var(--colors-gray-700);+ color: var(--colors-white);font-size: 11px;padding: 4px 6px;width: max-content;diff --git a/public/assets/styles/utility/_theme.scss b/public/assets/styles/utility/_theme.scssnew file mode 100644index 000000000..830dbf7dd--- /dev/null+++ b/public/assets/styles/utility/_theme.scss@@ -0,0 +1,45 @@+@mixin theme($theme-colors, $bodySelector) {+ body#{$bodySelector} {+ @each $name, $shades in $theme-colors {+ @if type-of($shades) == "map" {+ @each $shade, $color in $shades {+ .text-#{$name}-#{$shade} {+ color: #{$color};+ }+ .hover\:text-#{$name}-#{$shade}:hover {+ color: #{$color};+ }+ .bg-#{$name}-#{$shade} {+ background-color: #{$color};+ }+ .hover\:bg-#{$name}-#{$shade}:hover {+ background-color: #{$color};+ }+ .border-#{$name}-#{$shade} {+ border-color: #{$color};+ }+ --colors-#{$name}-#{$shade}: #{$color};+ }+ } @else {+ .text-#{$name} {+ color: #{$shades};+ }+ .bg-#{$name} {+ background-color: #{$shades};+ }+ .border-#{$name} {+ border-color: #{$shades};+ }+ --colors-#{$name}: #{$shades};+ }+ }+ }+}++@mixin set-theme($theme) {+ @if $theme == "light" {+ $colors: $light-colors !global;+ } @else if $theme == "dark" {+ $colors: $dark-colors !global;+ }+}diff --git a/public/assets/styles/utility/colors.scss b/public/assets/styles/utility/colors.scssindex c1fe079d3..853d0bbcc 100644--- a/public/assets/styles/utility/colors.scss+++ b/public/assets/styles/utility/colors.scss@@ -1,31 +1,3 @@-@each $name, $shades in $colors {- @if type-of($shades) == "map" {- @each $shade, $color in $shades {- .text-#{$name}-#{$shade} {- color: #{$color};- }- .hover\:text-#{$name}-#{$shade}:hover {- color: #{$color};- }- .bg-#{$name}-#{$shade} {- background-color: #{$color};- }- .hover\:bg-#{$name}-#{$shade}:hover {- background-color: #{$color};- }- .border-#{$name}-#{$shade} {- border-color: #{$color};- }- }- } @else {- .text-#{$name} {- color: #{$shades};- }- .bg-#{$name} {- background-color: #{$shades};- }- .border-#{$name} {- border-color: #{$shades};- }- }-}+@import "../variables/_colors.scss";+@import "../variables/_dark-colors.scss";+@import "../utility/_theme.scss";diff --git a/public/assets/styles/utility/display.scss b/public/assets/styles/utility/display.scssindex 0b58e6d89..09ebbbdca 100644--- a/public/assets/styles/utility/display.scss+++ b/public/assets/styles/utility/display.scss@@ -69,8 +69,8 @@.box {border-radius: get("border.radius.large");- background-color: get("colors.white");- border: 1px solid get("colors.gray.200");+ background-color: var(--colors-white);+ border: 1px solid var(--colors-gray-200);padding: spacing(4);}@@ -150,7 +150,7 @@.flex-x.flex--divide-#{$i} > * + * {padding-right: spacing($i);padding-left: spacing($i);- border: 0 solid get("colors.gray.200");+ border: 0 solid var(--colors-gray-200);border-left-width: 1px;}.flex-x.flex--divide-#{$i} > *:last-child {@@ -162,7 +162,7 @@.flex-y.flex--divide-#{$i} > * + * {padding-top: spacing($i);padding-bottom: spacing($i);- border: 0 solid get("colors.gray.200");+ border: 0 solid var(--colors-gray-200);border-top-width: 1px;}.flex-y.flex--divide-#{$i} > *:last-child {@@ -219,7 +219,6 @@border: 1px solid transparent;}-@each $i in 2, 3, 4, 6 {.border-#{$i} {border: #{$i}px solid transparent;@@ -233,7 +232,6 @@.hover {&:hover {- background-color: get("colors.gray.100");+ background-color: var(--colors-gray-100);}}-diff --git a/public/assets/styles/utility/text.scss b/public/assets/styles/utility/text.scssindex 68e99fdbd..8e74daf96 100644--- a/public/assets/styles/utility/text.scss+++ b/public/assets/styles/utility/text.scss@@ -11,7 +11,7 @@ pre:last-child {.text-large {font-size: get("font.size.2xl");- color: get("colors.gray.900");+ color: var(--colors-gray-900);font-weight: get("font.weight.bold");letter-spacing: -1px;}@@ -29,25 +29,25 @@ pre:last-child {.text-header {font-size: get("font.size.xl");- color: get("colors.gray.900");+ color: var(--colors-gray-900);font-weight: get("font.weight.medium");}.text-title {font-size: get("font.size.lg");- color: get("colors.gray.900");+ color: var(--colors-gray-900);font-weight: get("font.weight.medium");}.text-subtitle {font-size: get("font.size.base");- color: get("colors.gray.900");+ color: var(--colors-gray-900);font-weight: get("font.weight.medium");}.text-body {font-size: get("font.size.base");- color: get("colors.gray.700");+ color: var(--colors-gray-700);}.text-sm {@@ -65,17 +65,17 @@ pre:last-child {.text-category {font-size: get("font.size.xs");font-weight: get("font.weight.semibold");- color: get("colors.gray.600");+ color: var(--colors-gray-600);text-transform: uppercase;}.text-muted {font-size: get("font.size.xs");- color: get("colors.gray.700");+ color: var(--colors-gray-700);}.text-link {- color: get("colors.blue.600");+ color: var(--colors-blue-600);}.nowrap {@@ -85,7 +85,7 @@ pre:last-child {}.text-link:hover {- color: get("colors.blue.800");+ color: var(--colors-blue-800);text-decoration: underline;}diff --git a/public/assets/styles/variables.scss b/public/assets/styles/variables.scssindex b24052337..d8c737785 100644--- a/public/assets/styles/variables.scss+++ b/public/assets/styles/variables.scss@@ -10,9 +10,16 @@@import "variables/_functions";@import "variables/_colors";+@import "variables/_dark-colors";@import "variables/_spacing";@import "variables/_sizing";@import "variables/_text";+@import "utility/_theme.scss";++/* @include get-theme("dark"); */+$colors: $dark-colors;+@include theme($light-colors, '[data-theme="light"]');+@include theme($dark-colors, '[data-theme="dark"]');@include default.all;@include variable.all;diff --git a/public/assets/styles/variables/_colors.scss b/public/assets/styles/variables/_colors.scssindex 7274645af..7b8f28224 100644--- a/public/assets/styles/variables/_colors.scss+++ b/public/assets/styles/variables/_colors.scss@@ -1,13 +1,13 @@-$colors: (+$light-colors: ("gray": (- "100": #FCFAFA,- "200": #EEEBEB,- "300": #E0DCDD,- "400": #D2CDCF,- "500": #C4BEC0,- "600": #9D9598,- "700": #756E71,- "800": #4E474B,+ "100": #fcfafa,+ "200": #eeebeb,+ "300": #e0dcdd,+ "400": #d2cdcf,+ "500": #c4bec0,+ "600": #9d9598,+ "700": #756e71,+ "800": #4e474b,"900": #262225,"50": #f9fafb,),@@ -66,5 +66,5 @@ $colors: ("dark": var(--primary-color-dark, #03308a),),"white": #fff,+ "black": #262225,);-diff --git a/public/assets/styles/variables/_dark-colors.scss b/public/assets/styles/variables/_dark-colors.scssnew file mode 100644index 000000000..9362d26fd--- /dev/null+++ b/public/assets/styles/variables/_dark-colors.scss@@ -0,0 +1,69 @@+$dark-colors: (+ "gray": (+ "100": #2e2e2e,+ "200": #3a3a3a,+ "300": #474747,+ "400": #545454,+ "500": #616161,+ "600": #6d6d6d,+ "700": #7a7a7a,+ "800": #a1a1a1,+ "900": #d3d3d3,+ "50": #1a1a1a,+ ),+ "green": (+ "900": #0a3d1a,+ "800": #14532d,+ "700": #166534,+ "600": #15803d,+ "500": #22c55e,+ "400": #4ade80,+ "300": #86efac,+ "200": #bbf7d0,+ "100": #dcfce7,+ "50": #f0fdf4,+ ),+ "yellow": (+ "900": #4a2c0a,+ "800": #78350f,+ "700": #92400e,+ "600": #b45309,+ "500": #d97706,+ "400": #f59e0b,+ "300": #fbbf24,+ "200": #fde68a,+ "100": #fef3c7,+ "50": #fffbeb,+ ),+ "blue": (+ "100": #11263a,+ "200": #001a33,+ "300": #00306a,+ "400": #0440a3,+ "500": #124edb,+ "600": #3669ff,+ "700": #7091ff,+ "800": #b0c1ff,+ "900": #e0e4ff,+ "50": #f3fbff,+ ),+ "red": (+ "900": #4a1a1a,+ "800": #7f1d1d,+ "700": #991b1b,+ "600": #b91c1c,+ "500": #dc2626,+ "400": #ef4444,+ "300": #f87171,+ "200": #fca5a5,+ "100": #fecaca,+ "50": #fef2f2,+ ),+ "primary": (+ "light": var(--primary-color-light, #7a8efb),+ "base": var(--primary-color, #4d85ff),+ "dark": var(--primary-color-dark, #3b6ed9),+ ),+ "white": #1a1a1a,+ "black": #d3d3d3,+);diff --git a/public/components/Header.tsx b/public/components/Header.tsxindex a1d57e145..9a79b39d1 100644--- a/public/components/Header.tsx+++ b/public/components/Header.tsx@@ -1,5 +1,5 @@import React, { useState } from "react"-import { SignInModal, TenantLogo, NotificationIndicator, UserMenu } from "@fider/components"+import { SignInModal, TenantLogo, NotificationIndicator, UserMenu, ThemeSwitcher } from "@fider/components"import { useFider } from "@fider/hooks"import { HStack } from "./layout"import { Trans } from "@lingui/react/macro"@@ -27,6 +27,7 @@ export const Header = () => {</a>{fider.session.isAuthenticated && (<HStack spacing={2}>+ <ThemeSwitcher /><NotificationIndicator /><UserMenu /></HStack>diff --git a/public/components/NotificationIndicator.scss b/public/components/NotificationIndicator.scssindex 40d9434f1..d7ab49374 100644--- a/public/components/NotificationIndicator.scss+++ b/public/components/NotificationIndicator.scss@@ -7,7 +7,7 @@position: absolute;top: 2px;right: 2px;- background-color: get("colors.red.500");+ background-color: var(--colors-red-500);height: sizing(2);width: sizing(2);border-radius: 100%;diff --git a/public/components/Reactions.tsx b/public/components/Reactions.tsxindex 2bcf0ee06..68b8c26ad 100644--- a/public/components/Reactions.tsx+++ b/public/components/Reactions.tsx@@ -39,7 +39,7 @@ export const Reactions: React.FC<ReactionsProps> = ({ emojiSelectorRef, toggleRe<><spanonClick={() => setIsEmojiSelectorOpen(!isEmojiSelectorOpen)}- className="c-reactions-add-reaction relative text-gray-600 clickable inline-flex items-center px-1 py-1 rounded-full text-xs bg-blue-100 hover:bg-blue-200"+ className="c-reactions-add-reaction relative text-gray-600 clickable inline-flex items-center px-1 py-1 rounded-full text-xs bg-gray-100 hover:bg-gray-200"><Icon width="18" height="18" sprite={ReactionAdd} className="" /></span>diff --git a/public/components/ShowTag.scss b/public/components/ShowTag.scssindex 352d9049d..c33ac6bd9 100644--- a/public/components/ShowTag.scss+++ b/public/components/ShowTag.scss@@ -5,8 +5,8 @@justify-content: center;align-items: center;font-size: 13px;- color: get("colors.gray.900");- background-color: get("colors.gray.200");+ color: var(--colors-gray-900);+ background-color: var(--colors-gray-200);font-weight: 500;border-radius: 5px;// line-height: 18px;diff --git a/public/components/ThemeSwitcher.scss b/public/components/ThemeSwitcher.scssnew file mode 100644index 000000000..2376218b0--- /dev/null+++ b/public/components/ThemeSwitcher.scss@@ -0,0 +1,6 @@+.c-themeswitcher {+ border: none;+ background: transparent;+ color: var(--colors-gray-700);+ cursor: pointer;+}diff --git a/public/components/ThemeSwitcher.tsx b/public/components/ThemeSwitcher.tsxnew file mode 100644index 000000000..13a01e678--- /dev/null+++ b/public/components/ThemeSwitcher.tsx@@ -0,0 +1,28 @@+import IconMoon from "@fider/assets/images/heroicons-moon.svg"+import IconSun from "@fider/assets/images/heroicons-sun.svg"+import React, { useEffect, useState } from "react"+import { Icon } from "./common"+import "./ThemeSwitcher.scss"++export const ThemeSwitcher = () => {+ const [currentTheme, setCurrentTheme] = useState(localStorage.getItem("theme") || "light")++ const toggleTheme = () => {+ const currentTheme = localStorage.getItem("theme") || "light"+ const newTheme = currentTheme === "light" ? "dark" : "light"+ setCurrentTheme(newTheme)+ }++ useEffect(() => {+ localStorage.setItem("theme", currentTheme)+ document.body.setAttribute("data-theme", currentTheme)+ }, [currentTheme])++ const icon = currentTheme === "light" ? <Icon sprite={IconMoon} className="h-6" /> : <Icon sprite={IconSun} className="h-6" />++ return (+ <button onClick={toggleTheme} aria-label="Toggle theme" className="c-themeswitcher">+ {icon}+ </button>+ )+}diff --git a/public/components/VoteCounter.scss b/public/components/VoteCounter.scssindex 00b3d711e..740eaff0a 100644--- a/public/components/VoteCounter.scss+++ b/public/components/VoteCounter.scss@@ -11,21 +11,21 @@text-align: center;margin: 0 auto;padding: 3px 0 8px 0;- color: get("colors.gray.700");+ color: var(--colors-gray-700);display: flex;flex-direction: column;align-items: center;svg {- color: get("colors.gray.400");+ color: var(--colors-gray-400);margin-bottom: -2px;}&--voted,&:hover {- color: get("colors.primary.base");+ color: var(--colors-primary-base);svg {- color: get("colors.primary.base");+ color: var(--colors-primary-base);}}diff --git a/public/components/common/AvatarStack.scss b/public/components/common/AvatarStack.scssindex 4829ec2f1..eb8ad9f68 100644--- a/public/components/common/AvatarStack.scss+++ b/public/components/common/AvatarStack.scss@@ -2,7 +2,7 @@.c-avatar-stack {> * {- border: 2px solid white;+ border: 1px solid var(--colors-gray-300);}&--overlap & > * + * {diff --git a/public/components/common/Button.scss b/public/components/common/Button.scssindex af6261894..5fc8acafd 100644--- a/public/components/common/Button.scss+++ b/public/components/common/Button.scss@@ -22,7 +22,7 @@}&--tertiary {- color: get("colors.gray.900");+ color: var(--colors-gray-900);background-color: transparent;&:hover {@@ -31,34 +31,34 @@}&--secondary {- color: get("colors.gray.900");- background-color: get("colors.gray.100");- border: 1px solid get("colors.gray.300");+ color: var(--colors-gray-900);+ background-color: var(--colors-gray-100);+ border: 1px solid var(--colors-gray-300);&:hover {- background-color: get("colors.gray.100");+ background-color: var(--colors-gray-100);}}&--primary {- color: get("colors.white");- background-color: get("colors.primary.base");- border: 1px solid get("colors.primary.base");+ color: var(--colors-white);+ background-color: var(--colors-primary-base);+ border: 1px solid var(--colors-primary-base);&:hover {- background-color: get("colors.primary.dark");+ background-color: var(--colors-primary-dark);}}&--danger {- color: get("colors.red.600");- border: 1px solid get("colors.gray.300");- background-color: get("colors.white");+ color: var(--colors-red-600);+ border: 1px solid var(--colors-gray-300);+ background-color: var(--colors-white);&:hover {- color: get("colors.white");- border: 1px solid get("colors.red.600");- background-color: get("colors.red.600");+ color: var(--colors-white);+ border: 1px solid var(--colors-red-600);+ background-color: var(--colors-red-600);}}@@ -109,7 +109,7 @@width: 1.28571429em;height: 1.28571429em;border-radius: 500rem;- border: 0.2em solid get("colors.gray.500");+ border: 0.2em solid var(--colors-gray-500);}&:after {diff --git a/public/components/common/DevBanner.scss b/public/components/common/DevBanner.scssindex 54f17eec6..96f8ce78c 100644--- a/public/components/common/DevBanner.scss+++ b/public/components/common/DevBanner.scss@@ -6,8 +6,8 @@left: spacing(2);padding: spacing(2);font-size: get("font.size.base");- color: get("colors.red.700");- border: 2px solid get("colors.red.700");- background-color: get("colors.red.50");+ color: var(--colors-red-700);+ border: 2px solid var(--colors-red-700);+ background-color: var(--colors-red-50);opacity: 0.7;}diff --git a/public/components/common/Dropdown.scss b/public/components/common/Dropdown.scssindex 38d94f00e..e7b95bedd 100644--- a/public/components/common/Dropdown.scss+++ b/public/components/common/Dropdown.scss@@ -11,6 +11,7 @@border: none;padding: 0;cursor: pointer;+ color: var(--colors-black);}&__list {@@ -21,9 +22,9 @@min-width: sizing(40);max-width: sizing(60);padding: spacing(1) 0;- background-color: get("colors.white");+ background-color: var(--colors-white);border-radius: get("border.radius.medium");- border: 1px solid get("colors.gray.300");+ border: 1px solid var(--colors-gray-300);z-index: 10;&--left {@@ -35,13 +36,12 @@}&--fullscreen-small {- @include media("sm") {- position: fixed;- left: 0;- width: 100vw;- }+ @include media("sm") {+ position: fixed;+ left: 0;+ width: 100vw;+ }}-}&__listitem {@@ -49,13 +49,13 @@padding: spacing(2);&:hover {cursor: pointer;- background-color: get("colors.gray.100");+ background-color: var(--colors-gray-100);}}&__divider {margin: spacing(1);- background-color: get("colors.gray.200");+ background-color: var(--colors-gray-200);height: 1px;border: none;}diff --git a/public/components/common/Hint.scss b/public/components/common/Hint.scssindex 36d3db5da..8267fef01 100644--- a/public/components/common/Hint.scss+++ b/public/components/common/Hint.scss@@ -4,9 +4,9 @@position: relative;padding: spacing(4);margin-bottom: spacing(2);- color: get("colors.blue.800");- border-left: 2px solid get("colors.blue.800");- background-color: get("colors.blue.50");+ color: var(--colors-blue-800);+ border-left: 2px solid var(--colors-blue-800);+ background-color: var(--colors-blue-50);text-align: left;span {diff --git a/public/components/common/Loader.scss b/public/components/common/Loader.scssindex ab71b1060..4a4c2d0a0 100644--- a/public/components/common/Loader.scss+++ b/public/components/common/Loader.scss@@ -18,7 +18,7 @@width: 100%;height: 100%;border-radius: 500rem;- border: 0.2em solid get("colors.gray.300");+ border: 0.2em solid var(--colors-gray-300);}&:after {@@ -49,7 +49,7 @@display: block;text-align: center;font-size: get("font.size.xs");- color: get("colors.gray.700");+ color: var(--colors-gray-700);}}diff --git a/public/components/common/Markdown.scss b/public/components/common/Markdown.scssindex dd12a483e..53d346d4d 100644--- a/public/components/common/Markdown.scss+++ b/public/components/common/Markdown.scss@@ -7,8 +7,8 @@blockquote {padding: 0 spacing(2);- color: get("colors.gray.900");- border-left: 4px solid get("colors.gray.300");+ color: var(--colors-gray-900);+ border-left: 4px solid var(--colors-gray-300);margin: spacing(1) 0;}@@ -46,7 +46,7 @@overflow-x: auto;padding: spacing(2);line-height: 1.45;- background-color: get("colors.gray.200");+ background-color: var(--colors-gray-200);border-radius: 4px;code {display: inline;@@ -65,7 +65,7 @@padding: 0.2em;font-size: 85%;margin: 0;- background-color: get("colors.gray.200");+ background-color: var(--colors-gray-200);border-radius: 4px;}}diff --git a/public/components/common/Message.scss b/public/components/common/Message.scssindex 2d0814620..0afc4bc66 100644--- a/public/components/common/Message.scss+++ b/public/components/common/Message.scss@@ -10,20 +10,20 @@}&--success {- color: get("colors.green.800");- border-color: get("colors.green.800");- background-color: get("colors.green.50");+ color: var(--colors-green-800);+ border-color: var(--colors-green-800);+ background-color: var(--colors-green-50);}&--warning {- color: get("colors.yellow.800");- border-color: get("colors.yellow.800");- background-color: get("colors.yellow.50");+ color: var(--colors-yellow-800);+ border-color: var(--colors-yellow-800);+ background-color: var(--colors-yellow-50);}&--error {- color: get("colors.red.800");- border-color: get("colors.red.800");- background-color: get("colors.red.50");+ color: var(--colors-red-800);+ border-color: var(--colors-red-800);+ background-color: var(--colors-red-50);}}diff --git a/public/components/common/Modal.scss b/public/components/common/Modal.scssindex fd2d2429a..f35291964 100644--- a/public/components/common/Modal.scss+++ b/public/components/common/Modal.scss@@ -54,7 +54,7 @@ $c-modal-dimmer-padding: 1em;.c-modal-window {z-index: 101;text-align: left;- background: #fff;+ background: var(--colors-white);border: none;border-radius: 3px;animation: windowfadeIn 0.5s;@@ -81,7 +81,7 @@ $c-modal-dimmer-padding: 1em;font-size: get("font.size.lg");font-weight: 600;padding: 15px 20px;- border-bottom: 1px solid get("colors.gray.200");+ border-bottom: 1px solid var(--colors-gray-200);}.c-modal-content {@@ -89,11 +89,11 @@ $c-modal-dimmer-padding: 1em;}.c-modal-footer {- background: get("colors.gray.100");+ background: var(--colors-gray-100);padding: 10px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;- border-top: 1px solid get("colors.gray.300");+ border-top: 1px solid var(--colors-gray-300);&--right {text-align: right;}diff --git a/public/components/common/PoweredByFider.scss b/public/components/common/PoweredByFider.scssindex a2693d84e..a9e0d439d 100644--- a/public/components/common/PoweredByFider.scss+++ b/public/components/common/PoweredByFider.scss@@ -4,10 +4,10 @@text-align: center;a {- color: get("colors.blue.700");+ color: var(--colors-blue-700);font-size: 12px;}a:hover {- color: get("colors.gray.900");+ color: var(--colors-gray-900);}}diff --git a/public/components/common/Toggle.scss b/public/components/common/Toggle.scssindex 81da5b608..5408bbb74 100644--- a/public/components/common/Toggle.scss+++ b/public/components/common/Toggle.scss@@ -10,21 +10,21 @@padding: 0;position: relative;display: inline-flex;- height: sizing(4);- width: sizing(8);+ height: sizing(5);+ width: sizing(9);border: 2px solid transparent;- background-color: get("colors.gray.200");+ background-color: var(--colors-gray-200);border-radius: 50px;cursor: pointer;@include transition();span {pointer-events: none;- height: sizing(3);- width: sizing(3);+ height: sizing(4);+ width: sizing(4);display: inline-block;border-radius: 50px;- background-color: get("colors.white");+ background-color: var(--colors-white);transform: matrix(1, 0, 0, 1, 0, 0);@include transition();}@@ -34,7 +34,7 @@}&--enabled {- background-color: get("colors.green.600");+ background-color: var(--colors-green-600);span {transform: matrix(1, 0, 0, 1, 16, 0);diff --git a/public/components/common/UserName.scss b/public/components/common/UserName.scssindex e4c70594f..78efc5a82 100644--- a/public/components/common/UserName.scss+++ b/public/components/common/UserName.scss@@ -1,21 +1,21 @@@import "~@fider/assets/styles/variables.scss";.c-username {- color: get("colors.gray.900");+ color: var(--colors-gray-900);font-weight: 600;display: inline-flex;align-items: center;&--email {margin-left: 10px;- color: get("colors.gray.600");+ color: var(--colors-gray-600);font-size: get("font.size.xs");font-weight: 400;}&--staff {- color: get("colors.primary.base");- border-color: get("colors.primary.base");+ color: var(--colors-primary-base);+ border-color: var(--colors-primary-base);div {svg {diff --git a/public/components/common/form/Checkbox.scss b/public/components/common/form/Checkbox.scssindex 19e0cc0c9..f51e2d54d 100644--- a/public/components/common/form/Checkbox.scss+++ b/public/components/common/form/Checkbox.scss@@ -3,10 +3,10 @@.c-checkbox input {margin: 0px;appearance: none;- border: 1px solid get("colors.gray.300");+ border: 1px solid var(--colors-gray-300);height: sizing(4);width: sizing(4);- color: get("colors.primary.base");+ color: var(--colors-primary-base);-webkit-appearance: none;appearance: none;diff --git a/public/components/common/form/CommentEditor.scss b/public/components/common/form/CommentEditor.scssindex 01ec73ba0..cfa98534b 100644--- a/public/components/common/form/CommentEditor.scss+++ b/public/components/common/form/CommentEditor.scss@@ -19,7 +19,7 @@}.c-editor-toolbar {- border-bottom: 1px solid get("colors.gray.300");+ border-bottom: 1px solid var(--colors-gray-300);padding: spacing(1);min-height: 40px;width: 100%;@@ -39,18 +39,18 @@border-radius: get("border.radius.small");background: transparent;border: none;- color: get("colors.gray.700");+ color: var(--colors-gray-700);cursor: pointer;transition: all 0.2s ease;&:hover {- background-color: get("colors.gray.100");- color: get("colors.gray.900");+ background-color: var(--colors-gray-100);+ color: var(--colors-gray-900);}&.is-disabled {- // background-color: get("colors.gray.300");- color: get("colors.gray.500");+ // background-color: var(--colors-gray-300);+ color: var(--colors-gray-500);}svg {@@ -61,8 +61,8 @@.c-editor-button {&.is-active {- background-color: get("colors.gray.300");- color: get("colors.gray.900");+ background-color: var(--colors-gray-300);+ color: var(--colors-gray-900);}}@@ -71,10 +71,10 @@}.fider-tiptap-editor {- border: 1px solid #e5e7eb;+ border: 1px solid var(--colors-gray-400);border-radius: 6px;overflow: hidden;- background-color: get("colors.white");+ background-color: var(--colors-white);.tiptap {:first-child {@@ -90,10 +90,10 @@}.mention {- background-color: get("colors.blue.200");+ background-color: var(--colors-blue-200);border-radius: get("border.radius.medium");box-decoration-break: clone;- color: get("colors.blue.600");+ color: var(--colors-blue-600);padding-left: spacing(1);padding-right: spacing(1);padding-top: 4px;@@ -105,7 +105,7 @@// Placeholderp.tiptap-is-empty:first-child::before {- color: get("colors.gray.400");+ color: var(--colors-gray-400);content: attr(data-placeholder);float: left;height: 0;diff --git a/public/components/common/form/DisplayError.scss b/public/components/common/form/DisplayError.scssindex 548c8b5ec..673db80e5 100644--- a/public/components/common/form/DisplayError.scss+++ b/public/components/common/form/DisplayError.scss@@ -1,7 +1,7 @@@import "~@fider/assets/styles/variables.scss";.c-form-error {- color: get("colors.red.600");+ color: var(--colors-red-600);font-size: get("font.size.sm");ul {list-style: none;diff --git a/public/components/common/form/ImageUploader.scss b/public/components/common/form/ImageUploader.scssindex 93ae455fd..986f9ef59 100644--- a/public/components/common/form/ImageUploader.scss+++ b/public/components/common/form/ImageUploader.scss@@ -12,7 +12,7 @@padding: 5px;min-width: 50px;min-height: 50px;- border: 1px solid get("colors.gray.300");+ border: 1px solid var(--colors-gray-300);cursor: pointer;}.c-button {diff --git a/public/components/common/form/Input.scss b/public/components/common/form/Input.scssindex 3698b3cb0..7b50a8f51 100644--- a/public/components/common/form/Input.scss+++ b/public/components/common/form/Input.scss@@ -2,10 +2,11 @@.c-input {line-height: get("font.size.xl");- background-color: get("colors.white");+ background-color: var(--colors-white);+ color: var(--colors-black);width: 100%;padding: sizing(2);- border: 1px solid get("colors.gray.300");+ border: 1px solid var(--colors-gray-300);border-radius: get("border.radius.medium");-webkit-appearance: none;appearance: none;@@ -26,7 +27,7 @@&__suffix {display: flex;align-items: center;- background-color: get("colors.gray.200");+ background-color: var(--colors-gray-200);padding: spacing(2);border-top-right-radius: get("border.radius.medium");border-bottom-right-radius: get("border.radius.medium");@@ -37,7 +38,7 @@}&--error {- border-color: get("colors.red.600");+ border-color: var(--colors-red-600);}&--suffixed {diff --git a/public/components/common/form/MentionList.scss b/public/components/common/form/MentionList.scssindex b904b2c29..2b65e040b 100644--- a/public/components/common/form/MentionList.scss+++ b/public/components/common/form/MentionList.scss@@ -2,8 +2,8 @@/* Dropdown menu */.dropdown-menu {- background: get("colors.white");- border: 1px solid get("colors.gray.200");+ background: var(--colors-white);+ border: 1px solid var(--colors-gray-200);border-radius: get("border.radius.large");box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;display: flex;@@ -23,17 +23,17 @@padding: 8px 16px;font-weight: 500;width: 100%;- color: get("colors.gray.900");+ color: var(--colors-gray-900);background-color: transparent;&:hover,&:hover.is-selected {text-decoration: none;- background-color: get("colors.gray.300");+ background-color: var(--colors-gray-300);}&.is-selected {- background-color: get("colors.gray.200");+ background-color: var(--colors-gray-200);}}}diff --git a/public/components/common/form/RadioButton.scss b/public/components/common/form/RadioButton.scssindex a57f45543..cb956d46c 100644--- a/public/components/common/form/RadioButton.scss+++ b/public/components/common/form/RadioButton.scss@@ -3,10 +3,10 @@.c-radiobutton input {margin: 0px;appearance: none;- border: 1px solid get("colors.gray.300");+ border: 1px solid var(--colors-gray-300);height: sizing(4);width: sizing(4);- color: get("colors.primary.base");+ color: var(--colors-primary-base);border-radius: get("border.radius.full");-webkit-appearance: none;appearance: none;diff --git a/public/components/common/form/Select.scss b/public/components/common/form/Select.scssindex 916f66b3f..b51ab54cf 100644--- a/public/components/common/form/Select.scss+++ b/public/components/common/form/Select.scss@@ -1,11 +1,12 @@@import "~@fider/assets/styles/variables.scss";.c-select {- background-color: get("colors.white");+ background-color: var(--colors-white);+ color: var(--colors-black);width: 100%;line-height: get("font.size.xl");padding: spacing(2);- border: 1px solid get("colors.gray.300");+ border: 1px solid var(--colors-gray-300);border-radius: get("border.radius.medium");appearance: none;background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");@@ -20,6 +21,6 @@}&--error {- border-color: get("colors.red.600");+ border-color: var(--colors-red-600);}}diff --git a/public/components/common/form/Select2.scss b/public/components/common/form/Select2.scssindex d381a398b..04443d704 100644--- a/public/components/common/form/Select2.scss+++ b/public/components/common/form/Select2.scss@@ -9,10 +9,10 @@// font-size: get("font.size.sm");// line-height: 20px;// text-align: left;-// background-color: get("colors.white");+// background-color: var(--colors-white);// padding: sizing(2);// border-radius: get("border.radius.medium");-// border: 1px solid get("colors.gray.300");+// border: 1px solid var(--colors-gray-300);// }// &__list {@@ -22,9 +22,9 @@// overflow: auto;// max-height: 15rem;// padding: spacing(1) 0;-// background-color: get("colors.white");+// background-color: var(--colors-white);// border-radius: get("border.radius.medium");-// border: 1px solid get("colors.gray.300");+// border: 1px solid var(--colors-gray-300);// list-style-type: none;// z-index: 10;@@ -32,7 +32,7 @@// padding: spacing(2);// &:hover {// cursor: pointer;-// background-color: get("colors.gray.200");+// background-color: var(--colors-gray-200);// }// }// }diff --git a/public/components/common/form/TextArea.scss b/public/components/common/form/TextArea.scssindex eb346e78f..d5c4117d5 100644--- a/public/components/common/form/TextArea.scss+++ b/public/components/common/form/TextArea.scss@@ -1,12 +1,13 @@@import "~@fider/assets/styles/variables.scss";.c-textarea {- background-color: get("colors.white");+ background-color: var(--colors-white);+ color: var(--colors-black);width: 100%;line-height: get("font.size.xl");padding: spacing(2);resize: none;- border: 1px solid get("colors.gray.300");+ border: 1px solid var(--colors-gray-300);border-radius: get("border.radius.medium");-webkit-appearance: none;appearance: none;@@ -15,6 +16,6 @@@include disabled();}&--error {- border-color: get("colors.red.600");+ border-color: var(--colors-red-600);}}diff --git a/public/components/index.tsx b/public/components/index.tsxindex 0e5109b29..7833f5b30 100644--- a/public/components/index.tsx+++ b/public/components/index.tsx@@ -1,4 +1,5 @@export * from "./ErrorBoundary"+export * from "./ThemeSwitcher"export * from "./ShowPostResponse"export * from "./ShowPostStatus"export * from "./ShowTag"diff --git a/public/pages/Administration/components/SideMenu.scss b/public/pages/Administration/components/SideMenu.scssindex 1bd480e73..2cdf9f4f0 100644--- a/public/pages/Administration/components/SideMenu.scss+++ b/public/pages/Administration/components/SideMenu.scss@@ -3,11 +3,11 @@.c-side-menu {&__item {padding: spacing(4);- border-bottom: 1px solid get("colors.gray.200");- color: get("colors.gray.900");+ border-bottom: 1px solid var(--colors-gray-200);+ color: var(--colors-gray-900);&:hover {- background-color: get("colors.gray.100");+ background-color: var(--colors-gray-100);}&:last-child {@@ -15,12 +15,12 @@}&--active {- color: get("colors.primary.base");- border-left: 2px solid get("colors.primary.base");+ color: var(--colors-primary-base);+ border-left: 2px solid var(--colors-primary-base);font-weight: 600;- background-color: get("colors.white");+ background-color: var(--colors-white);&:hover {- color: get("colors.primary.base");+ color: var(--colors-primary-base);}}}diff --git a/public/pages/Administration/components/webhook/WebhookListItem.scss b/public/pages/Administration/components/webhook/WebhookListItem.scssindex f52323815..5cdd1f5fa 100644--- a/public/pages/Administration/components/webhook/WebhookListItem.scss+++ b/public/pages/Administration/components/webhook/WebhookListItem.scss@@ -5,15 +5,15 @@vertical-align: middle;&--enabled {- color: get("colors.green.500");+ color: var(--colors-green-500);}&--disabled {- color: get("colors.yellow.500");+ color: var(--colors-yellow-500);}&--failed {- color: get("colors.red.500");+ color: var(--colors-red-500);}}}diff --git a/public/pages/Administration/components/webhook/WebhookProperties.scss b/public/pages/Administration/components/webhook/WebhookProperties.scssindex 7c328a6d8..b60ecffaf 100644--- a/public/pages/Administration/components/webhook/WebhookProperties.scss+++ b/public/pages/Administration/components/webhook/WebhookProperties.scss@@ -44,7 +44,7 @@@each $color in ("gray", "blue", "green", "red") {&--#{$color} {font-family: get("font.family.code");- color: get("colors.#{$color}.600");+ color: var(--colors-#{$color}-600);}}diff --git a/public/pages/Home/Home.page.scss b/public/pages/Home/Home.page.scssindex 9fb06910a..a00314ef5 100644--- a/public/pages/Home/Home.page.scss+++ b/public/pages/Home/Home.page.scss@@ -15,9 +15,9 @@.p-home {&__welcome-col {> :first-child {- background-color: get("colors.white");+ background-color: var(--colors-white);border-radius: get("border.radius.large");- border: 1px solid get("colors.gray.200");+ border: 1px solid var(--colors-gray-200);@include media("lg") {}@@ -25,9 +25,9 @@}&__posts-col {- background-color: get("colors.white");+ background-color: var(--colors-white);border-radius: get("border.radius.large");- border: 1px solid get("colors.gray.200");+ border: 1px solid var(--colors-gray-200);@include media("lg") {}diff --git a/public/pages/Legal/Legal.page.scss b/public/pages/Legal/Legal.page.scssindex b27e1fac8..851cd28c6 100644--- a/public/pages/Legal/Legal.page.scss+++ b/public/pages/Legal/Legal.page.scss@@ -23,11 +23,11 @@}a {- color: get("colors.blue.600");+ color: var(--colors-blue-600);}a:hover {- color: get("colors.blue.800");+ color: var(--colors-blue-800);text-decoration: underline;}@@ -37,10 +37,10 @@th,td {padding: spacing(1);- border-bottom: 1px solid get("colors.gray.300");+ border-bottom: 1px solid var(--colors-gray-300);}th {- background-color: get("colors.gray.100");+ background-color: var(--colors-gray-100);}}}diff --git a/public/pages/ShowPost/ShowPost.page.scss b/public/pages/ShowPost/ShowPost.page.scssindex 0f882b6ef..02d0e1f06 100644--- a/public/pages/ShowPost/ShowPost.page.scss+++ b/public/pages/ShowPost/ShowPost.page.scss@@ -7,7 +7,7 @@.p-show-post {&__main-col {- // background-color: get("colors.white");+ // background-color: var(--colors-white);padding: spacing(4);border-radius: get("border.radius.large");margin-bottom: spacing(4);@@ -15,7 +15,7 @@&__action-col {> :first-child {- // background-color: get("colors.white");+ // background-color: var(--colors-white);padding: spacing(4);// border-radius: get("border.radius.large");}diff --git a/public/pages/ShowPost/components/FollowButton.tsx b/public/pages/ShowPost/components/FollowButton.tsxindex ecb6c6ebf..b596f666a 100644--- a/public/pages/ShowPost/components/FollowButton.tsx+++ b/public/pages/ShowPost/components/FollowButton.tsx@@ -38,7 +38,7 @@ export const FollowButton = (props: NotificationsPanelProps) => {</span></Button>) : (- <Button className="w-full text-blue-500 bg-white border border-blue-500 no-focus" onClick={subscribeOrUnsubscribe} disabled={fider.isReadOnly}>+ <Button className="w-full text-blue-600 bg-white border border-blue-600 no-focus" onClick={subscribeOrUnsubscribe} disabled={fider.isReadOnly}><Icon sprite={IconPlus} /><span><Trans id="label.follow">Follow</Trans>diff --git a/public/pages/ShowPost/components/MentionSelector.scss b/public/pages/ShowPost/components/MentionSelector.scssindex efc4c741b..acec6a61a 100644--- a/public/pages/ShowPost/components/MentionSelector.scss+++ b/public/pages/ShowPost/components/MentionSelector.scss@@ -5,7 +5,7 @@z-index: 1000;width: 200px;border-radius: get("border.radius.small");- background-color: get("colors.white");- border: 1px solid get("colors.gray.200");+ background-color: var(--colors-white);+ border: 1px solid var(--colors-gray-200);padding: spacing(2);}diff --git a/public/pages/ShowPost/components/TagsPanel.scss b/public/pages/ShowPost/components/TagsPanel.scssindex 0e7777964..4debbcec3 100644--- a/public/pages/ShowPost/components/TagsPanel.scss+++ b/public/pages/ShowPost/components/TagsPanel.scss@@ -18,9 +18,9 @@min-height: 3rem;width: 100%;padding: 0.5rem;- border: 1px solid get("colors.gray.500");+ border: 1px solid var(--colors-gray-500);border-radius: 0.25rem;- background-color: get("colors.white");+ background-color: var(--colors-white);cursor: pointer;}@@ -28,14 +28,14 @@display: flex;align-items: center;margin: 0.25rem;- background-color: get("colors.gray.200");+ background-color: var(--colors-gray-200);border-radius: 0.25rem;- color: get("colors.gray.900");+ color: var(--colors-gray-900);}.remove-button {margin: 0 0.25rem;- color: get("colors.gray.600");+ color: var(--colors-gray-600);background: none;border: none;font-size: 1rem;@@ -45,7 +45,7 @@}.remove-button:hover {- color: get("colors.red.500");+ color: var(--colors-red-500);}.search-input {@@ -54,6 +54,8 @@margin: 0.25rem;padding: 0.25rem;border: none;+ background-color: var(--colors-white);+ color: var(--colors-black);outline: none;}@@ -66,8 +68,8 @@z-index: 10;width: 100%;margin-top: 0.25rem;- background-color: get("colors.white");- border: 1px solid get("colors.gray.500");+ background-color: var(--colors-white);+ border: 1px solid var(--colors-gray-500);border-radius: 0.25rem;max-height: 15rem;overflow-y: auto;@@ -79,10 +81,10 @@}.option-item:hover {- background-color: get("colors.gray.100");+ background-color: var(--colors-gray-100);}.no-options {padding: 0.5rem;- color: get("colors.gray.900");+ color: var(--colors-gray-900);}diff --git a/views/base.html b/views/base.htmlindex 7d17c01e0..e6948539f 100644--- a/views/base.html+++ b/views/base.html@@ -1,5 +1,5 @@<!DOCTYPE html>-<html lang="{{ .public.settings.locale }}">+<html lang="{{ .public.settings.locale }}" data-theme="light"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1">