[RS-FE] Add color schemes

master
Araozu 2023-12-07 12:47:19 -05:00
parent ceca19377a
commit 26b55988ec
2 changed files with 2 additions and 41 deletions

View File

@ -1,42 +1,3 @@
/*
* BLUE
*/
:root {
--c-blue-primary: #adc6ff;
--c-blue-on-primary: #002e69;
--c-blue-primary-container: #0e448e;
--c-blue-on-primary-container: #d8e2ff;
--c-blue-background: #1b1b1f;
--c-blue-on-background: #e3e2e6;
--c-blue-surface: #1b1b1f;
--c-blue-on-surface: #e3e2e6;
--c-blue-outline: #8e9099;
--c-blue-surface-variant: #44474f;
--c-blue-on-surface-variant: #c4c6d0;
--c-blue-success: #7cdc6d;
--c-blue-on-success: #003a02;
}
@media (prefers-color-scheme: light) {
:root {
--c-blue-primary: #315da8;
--c-blue-on-primary: #ffffff;
--c-blue-primary-container: #d8e2ff;
--c-blue-on-primary-container: #001a41;
--c-blue-background: #fefbff;
--c-blue-on-background: #1b1b1f;
--c-blue-surface: #fefbff;
--c-blue-on-surface: #1b1b1f;
--c-blue-outline: #74777f;
--c-blue-surface-variant: #e1e2ec;
--c-blue-on-surface-variant: #44474f;
--c-blue-success: #006e08;
--c-blue-on-success: #ffffff;
}
}
:root { :root {
--c-error: #ffb4ab; --c-error: #ffb4ab;

View File

@ -1,5 +1,5 @@
export const applyColors = (colorName) => { const applyColors = (colorName) => {
const styleStr = ` const styleStr = `
:root { :root {
--c-primary: var(--c-${colorName}-primary); --c-primary: var(--c-${colorName}-primary);
@ -36,7 +36,7 @@ export const applyColors = (colorName) => {
`; `;
// Check for a previous style element in the head // Check for a previous style element in the head
const styleEl = document.getElementById("color-scheme-style"); let styleEl = document.getElementById("color-scheme-style");
if (styleEl === null) { if (styleEl === null) {
styleEl = document.createElement("style"); styleEl = document.createElement("style");