♻️ Move colors to css variables

This commit is contained in:
2022-06-28 22:48:52 +02:00
parent 62858870b4
commit e2635b1c20
9 changed files with 27 additions and 17 deletions

View File

@ -1,12 +1,23 @@
:root { :root {
--bg-color: #353535; --bg-color: #353535;
--element-color: #333030;
--element-color-hover: #292424;
--element-border-input: #34631f;
--element-border-action: #1f5b63;
--text-color: #bdbdbd; --text-color: #bdbdbd;
--font-family: "sourcesanspro"; --font-family: "sourcesanspro";
--titlebar-color: #212121; --titlebar-color: #212121;
--titlebar-element-active-color: #335723;
--bottomnav-color: #555555; --bottomnav-color: #555555;
--bottomnav-icon-color: #c7c7c7; --bottomnav-icon-color: #c7c7c7;
--bottomnav-icon-active-color: #456c47; --bottomnav-icon-active-color: #456c47;
--bottomnav-active-color: #7ca74b; --bottomnav-active-color: #7ca74b;
--loader-color: #7ca74b;
--substitution-background-change: #14587e;
--substitution-background-cancellation: #7d2b2d;
--substitution-background-addition: #476331;
--substitution-background-deletion: #7d2b2d;
--substitution-background-unchanged: #26272a;
} }
html, html,

View File

@ -34,7 +34,7 @@ defineProps({
width: 48px; width: 48px;
height: 48px; height: 48px;
border: 5px solid; border: 5px solid;
border-color: #7ca74b transparent; border-color: var(--loader-color) transparent;
border-radius: 50%; border-radius: 50%;
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;

View File

@ -61,7 +61,7 @@ a {
} }
a.router-link-active { a.router-link-active {
background-color: #335723; background-color: var(--titlebar-element-active-color);
border-radius: 5px; border-radius: 5px;
} }
</style> </style>

View File

@ -29,8 +29,8 @@ export function getSubstitutionColor(substitution) {
if (!substitution) return; if (!substitution) return;
switch (substitution.type) { switch (substitution.type) {
case "change": case "change":
return "background-color: #14587e;"; return "background-color: var(--substitution-background-change);";
case "cancellation": case "cancellation":
return "background-color: #7d2b2d;"; return "background-color: var(--substitution-background-cancellation);";
} }
} }

View File

@ -23,11 +23,11 @@ function getChar(type) {
function getColor(type) { function getColor(type) {
switch (type) { switch (type) {
case "change": case "change":
return "background-color: #14587E;"; return "background-color: var(--substitution-background-change)";
case "addition": case "addition":
return "background-color: #476331;"; return "background-color: var(--substitution-background-addition);";
case "deletion": case "deletion":
return "background-color: #7D2B2D;"; return "background-color: var(--substitution-background-deletion);";
} }
} }
</script> </script>
@ -70,7 +70,6 @@ function getColor(type) {
.change { .change {
display: grid; display: grid;
background-color: #26272a;
min-height: 35px; min-height: 35px;
border-radius: 11px; border-radius: 11px;
margin: 10px 0px; margin: 10px 0px;

View File

@ -24,7 +24,7 @@
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
color: #bdbdbd; color: var(--text-color);
} }
form { form {
@ -36,10 +36,10 @@ form {
input { input {
border: 0px; border: 0px;
outline: none; outline: none;
background-color: #3a3737; background-color: var(--element-color);
padding: 5px 5px; padding: 5px 5px;
margin: 5px 0; margin: 5px 0;
border: 2px solid #34631f; border: 2px solid var(--element-border-input);
border-radius: 5px; border-radius: 5px;
color: #bdbdbd; color: #bdbdbd;
} }
@ -47,9 +47,9 @@ input {
button { button {
outline: none; outline: none;
padding: 5px 5px; padding: 5px 5px;
border: 2px solid #1f5b63; border: 2px solid var(--element-border-action);
border-radius: 5px; border-radius: 5px;
color: #bdbdbd; color: var(--text-color);
background-color: #242121; background-color: var(--element-color);
} }
</style> </style>

View File

@ -87,7 +87,7 @@ select {
padding: 5px 0px; padding: 5px 0px;
margin: 5px 0px; margin: 5px 0px;
outline: none; outline: none;
border: 2px solid #34631f; border: 2px solid var(--element-border-input);
border-radius: 5px; border-radius: 5px;
} }

View File

@ -37,7 +37,7 @@ const substitutions = computed(() => {
.substitution { .substitution {
display: grid; display: grid;
background-color: #26272a; background-color: var(--substitution-background-unchanged);
min-height: 35px; min-height: 35px;
border-radius: 11px; border-radius: 11px;
margin: 10px 0px; margin: 10px 0px;

View File

@ -95,7 +95,7 @@ function isCancelled(substitution) {
.lesson { .lesson {
display: grid; display: grid;
background-color: #26272a; background-color: var(--substitution-background-unchanged);
min-height: 50px; min-height: 50px;
border-radius: 11px; border-radius: 11px;
margin: 10px 0px; margin: 10px 0px;