Skip to content

Commit

Permalink
documented the theme variable
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Nov 18, 2023
1 parent 7a70af6 commit 0ab4d87
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions webclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,15 @@ Each of those files are similar but differ in some aspects.
If you serve the release build with a webserver (such as Nginx) you need to select the correct files based on the request URL and headers.

```plain
<theme>-<lang>.html
↑ ↑
│ └── The page language. Either "de" or "en" at the moment.
│ It should be selected based on the "lang" Cookie or else the "Accept-Language" header.
<theme>.html
└── The page theme. Either "light" or "dark" at the moment.
It should be selected based on the "theme" Cookie ("light" by default).
```

The language-selector is working in development and this differentialtion is only happening in the build.
For the theme we can not do so for some reason (If you know of a better way, hit us up).
To test a different theme, you can change `$theme` [here](./src/assets/variables.scss). Values are `light` and `dark`.
To test a different theme, you can change `$theme` [here](./src/assets/variables.scss) and `theme='...'` [here](./index.html). Values are `light` and `dark`.

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion webclient/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for THEME in light dark
do
# make sure we are really only building the right theme
sed -i "s/\$theme: .*/\$theme: \"${THEME}\";/" src/assets/variables.scss
sed -i "s/>THEME</${THEME}/" index.html
sed -i "s/class='light'/${THEME}/" index.html

echo "Building ${THEME}"
npm run build-only
Expand Down
2 changes: 1 addition & 1 deletion webclient/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="de" prefix="og: https://ogp.me/ns#" class=">THEME<">
<html lang="de" prefix="og: https://ogp.me/ns#" class='light'>
<head>
<script type="application/ld+json">
{
Expand Down

0 comments on commit 0ab4d87

Please sign in to comment.