[RS-FE] Add color schemes
This commit is contained in:
parent
ceca19377a
commit
26b55988ec
@ -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;
|
||||||
|
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user