Skip to content

Commit

Permalink
tailwind: upgrade a17t, somewhat functional dark mode
Browse files Browse the repository at this point in the history
instead of adding dark: variants to each element, a preprocessor script
adds them. still needs to be implemented to typescript.
  • Loading branch information
hrfee committed Dec 30, 2021
1 parent 57e6469 commit 18ae035
Show file tree
Hide file tree
Showing 26 changed files with 2,272 additions and 431 deletions.
12 changes: 9 additions & 3 deletions Makefile
Expand Up @@ -118,18 +118,24 @@ bundle-css:
-mkdir -p $(DATA)/web/css
$(info bundling css)
$(ESBUILD) --bundle css/base.css --outfile=$(DATA)/web/css/bundle.css --external:remixicon.css --minify
npx tailwindcss -i $(DATA)/web/css/bundle.css -o $(DATA)/web/css/bundle.css

inline:
cp html/crash.html $(DATA)/crash.html
$(UNCSS)
node scripts/inline.js root $(DATA) $(DATA)/crash.html $(DATA)/crash.html
rm $(DATA)/bundle.css

variants-html:
$(info copying html)
cp -r html $(DATA)/
$(info adding dark variants to html)
scripts/dark-variant.sh $(DATA)/html

copy:
$(info copying fonts)
cp -r node_modules/remixicon/fonts/remixicon.css node_modules/remixicon/fonts/remixicon.woff2 $(DATA)/web/css/
$(info copying html)
cp -r html $(DATA)/
$(info copying crash page)
mv $(DATA)/crash.html $(DATA)/html/
$(info copying static data)
-mkdir -p $(DATA)/web
Expand Down Expand Up @@ -159,4 +165,4 @@ clean:
-rm docs/docs.go docs/swagger.json docs/swagger.yaml
go clean

all: configuration npm email typescript bundle-css inline swagger copy compile
all: configuration npm email typescript variants-html bundle-css inline swagger copy compile
11 changes: 7 additions & 4 deletions css/base.css
@@ -1,10 +1,13 @@
@import "../node_modules/a17t/dist/a17t.css";
@import "remixicon.css";
@import "./modal.css";
@import "./dark.css";
@import "./tooltip.css";
@import "./loader.css";

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--border-width-default: 2px;
--border-width-2: 3px;
Expand All @@ -16,7 +19,7 @@
--settings-section-button-filter: 90%;
}

.body {
.dark body {
background-color: #101010;
}

Expand Down Expand Up @@ -543,10 +546,10 @@ div.card:contains(section.banner.footer) {
padding: var(--spacing-4, 1rem);
}

.button.discord.\!normal {
.button.discord.\@low {
background-color: rgba(88, 101, 242,60%);
}

.button.discord.\!normal:not(.lang-link) {
.button.discord.\@low:not(.lang-link) {
color: rgba(38, 51, 192, 90%);
}
4 changes: 2 additions & 2 deletions css/dark.css
@@ -1,4 +1,4 @@
.dark-theme {
.dark {

--settings-section-button-filter: 110%;

Expand Down Expand Up @@ -86,6 +86,6 @@
display: initial;
}

.dark-theme select option {
.dark select option {
background: #202020;
}

0 comments on commit 18ae035

Please sign in to comment.