adds dark mode

This commit is contained in:
Christian Beutel
2024-02-22 01:00:09 +01:00
parent a24662a56e
commit 442e13b7c7
27 changed files with 240 additions and 83 deletions

102
web/src/css/app.css Normal file
View File

@@ -0,0 +1,102 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-Thin.ttf") format("truetype");
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-ThinItalic.ttf") format("truetype");
font-weight: 100;
font-style: italic;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-ExtraLight.ttf") format("truetype");
font-weight: 200;
font-style: normal;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-ExtraLight.ttf") format("truetype");
font-weight: 200;
font-style: italic;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-Light.ttf") format("truetype");
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-LightItalic.ttf") format("truetype");
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-Regular.ttf") format("truetype");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-Italic.ttf") format("truetype");
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-Medium.ttf") format("truetype");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-MediumItalic.ttf") format("truetype");
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-SemiBold.ttf") format("truetype");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-SemiBoldItalic.ttf") format("truetype");
font-weight: 600;
font-style: italic;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-Bold.ttf") format("truetype");
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: "IBMPlexSans";
src: url("/fonts/IBMPlexSans/IBMPlexSans-BoldItalic.ttf") format("truetype");
font-weight: 700;
font-style: italic;
}

102
web/src/css/components.css Normal file
View File

@@ -0,0 +1,102 @@
@import 'tailwindcss/utilities';
@import 'tailwindcss/base';
@import 'tailwindcss/components';
.btn-primary {
@apply h-10 text-white rounded-lg px-4 py-2 bg-primary font-semibold transition-all hover:bg-primary-hover focus:ring-4 ring-input-border-focus
}
.btn-large {
@apply h-12 leading-8
}
.btn-secondary {
@apply rounded-lg px-4 py-2 border border-input-border-focus font-medium transition-all hover:bg-secondary-hover focus:ring-4 ring-input-border-focus
}
.btn-danger {
@apply h-10 text-white rounded-lg px-4 py-2 bg-red-500 font-semibold transition-all hover:bg-red-600 focus:ring-4 ring-red-100
}
.btn-disabled {
@apply bg-gray-500 hover:bg-gray-500
}
.btn-icon {
@apply rounded-full aspect-square h-7 hover:bg-secondary-hover focus:ring-4 ring-input-border-focus transition-colors;
}
.tab {
@apply p-4 rounded-t-lg
}
.tab:hover {
@apply bg-gray-100
}
.tab-active {
@apply bg-primary text-white
}
.tab-active:hover {
@apply bg-primary
}
.tooltip {
position: relative;
}
.tooltip:before,
.tooltip:after {
display: block;
opacity: 0;
pointer-events: none;
position: absolute;
transform: translate3d(0, -10px, 0);
transition: all .15s ease-in-out;
}
.tooltip:before {
background: rgba(36, 39, 52, 0.75);
border-radius: 4px;
color: #fff;
content: attr(data-title);
font-size: 14px;
padding: 6px 10px;
top: 24px;
white-space: nowrap;
}
.tooltip:hover:after,
.tooltip:hover:before {
opacity: 1;
transform: translate3d(0, 0, 0);
}
.spinner {
display: inline-block;
width: 32px;
height: 32px;
}
.spinner:after {
content: " ";
display: block;
width: 32px;
height: 32px;
border-radius: 50%;
border: 6px solid #fff;
border-color: #fff transparent #fff transparent;
animation: spinner 1.2s linear infinite;
}
@keyframes spinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

47
web/src/css/theme.css Normal file
View File

@@ -0,0 +1,47 @@
.light {
--primary: 36, 39, 52;
--primary-hover: 17, 24, 39;
--secondary-hover: 243, 244, 246;
--background: 255, 255, 255;
--content: 0, 0, 0;
--input-background: 249, 250, 251;
--input-border: 209, 213, 219;
--input-border-focus: 36, 39, 52;
--menu-background: 255, 255, 255;
--menu-item-background-hover: 243, 244, 246;
--menu-item-background-focus: 229, 231, 235;
--footer-background: 36, 39, 52;
--separator: 17, 24, 39;
background: rgba(var(--background));
color: rgba(var(--content));
}
.dark {
--primary: 36, 39, 52;
--primary-hover: 44, 48, 64;
--secondary-hover: 36, 39, 52;
--background: 7, 10, 36;
--content: 255, 255, 255;
--input-background: 36, 39, 52;
--input-border: 43, 46, 61;
--input-border-focus: 108, 115, 150;
--menu-background: 33, 36, 54;
--menu-item-background-hover: 43, 46, 69;
--menu-item-background-focus: 25, 26, 41;
--footer-background: 10, 14, 48;
--separator: 108, 115, 150;
background: rgba(var(--background));
color: rgba(var(--content));
}