Skip to content

Commit 359f1ff

Browse files
committed
feat(ui): Rework theming system, add new theme.
1 parent 2b83a38 commit 359f1ff

38 files changed

+1056
-705
lines changed

docs/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ services:
121121
icon: "fas fa-code-branch"
122122
# A path to an image can also be provided. Note that icon take precedence if both icon and logo are set.
123123
# logo: "path/to/logo"
124+
# class: "highlight-purple" # Optional css class to add on the service group.
124125
items:
125126
- name: "Awesome app"
126127
logo: "assets/tools/sample.png"

docs/theming.md

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,76 @@
11
# Theming
22

3-
## Customization from yaml configuration file
3+
## Change theme
44

5-
Some aspect of the theme can be customized using the yaml configuration file.
5+
the default theme can be changed using the yaml configuration file
6+
7+
```yaml
8+
theme: default # 'default', 'walkxcode', or 'neon' see files in 'src/assets/themes'.
9+
```
10+
11+
## Colors and background customization
12+
13+
Default colors and background can be customized for each theme variant (light and dark), using either the yaml config file, or the css variables (cf "Additional stylesheets" below).
14+
15+
### Available options
16+
17+
| yaml | css | description |
18+
| --------------------- | ----------------------- | --- |
19+
| `highlight-primary` | `--highlight-primary` | header background, group title icons |
20+
| `highlight-secondary` | `--highlight-secondary` | navbar background, default tag color |
21+
| `highlight-hover` | `--highlight-hover` | navbar links hover, search input background |
22+
| `background` | `--background` | page background color |
23+
| `card-background` | `--card-background` | service card background color |
24+
| `text` | `--text` | main text color |
25+
| `text-header` | `--text-header` | header text color |
26+
| `text-title` | `--text-title` | service card title color |
27+
| `text-subtitle` | `--text-subtitle` | service card subtitle color |
28+
| `card-shadow` | `--card-shadow` | Service card `box-shadow` |
29+
| `link` | `--link` | Links color (footer & message), service card icon color |
30+
| `link-hover` | `--link-hover` | Links hover color (footer & message), service card icon hover color |
31+
| `background-image` | `--background-image` | page background image url (when used in css, set `url(<image-url>)` insted of just the url. see exemple below)|
32+
33+
34+
yaml exemple
635

736
```yml
837
colors:
938
light:
1039
highlight-primary: "#3367d6"
11-
highlight-secondary: "#4285f4"
12-
highlight-hover: "#5a95f5"
13-
background: "#f5f5f5"
14-
card-background: "#ffffff"
15-
text: "#363636"
16-
text-header: "#424242"
17-
text-title: "#303030"
18-
text-subtitle: "#424242"
19-
card-shadow: rgba(0, 0, 0, 0.1)
20-
link: "#3273dc"
21-
link-hover: "#363636"
22-
background-image: "assets/your/light/bg.png"
40+
background-image: "assets/your/light/bg.webp"
41+
...
2342
dark:
2443
highlight-primary: "#3367d6"
25-
highlight-secondary: "#4285f4"
26-
highlight-hover: "#5a95f5"
27-
background: "#131313"
28-
card-background: "#2b2b2b"
29-
text: "#eaeaea"
30-
text-header: "#ffffff"
31-
text-title: "#fafafa"
32-
text-subtitle: "#f5f5f5"
33-
card-shadow: rgba(0, 0, 0, 0.4)
34-
link: "#3273dc"
35-
link-hover: "#ffdd57"
36-
background-image: "assets/your/dark/bg.png"
44+
background-image: "assets/your/dark/bg.webp"
45+
...
46+
```
47+
48+
CSS exemple
49+
50+
```css
51+
.light {
52+
--highlight-primary: #3367d6;
53+
--background-image: url("assets/your/light/bg.webp");
54+
...
55+
}
56+
57+
.dark {
58+
--highlight-primary: #3367d6;
59+
--background-image: url("assets/your/dark/bg.webp");
60+
...
61+
}
3762
```
3863

3964
## Additional stylesheets
4065

41-
One or more additional stylesheets can be loaded to add or override style from the current theme. Use the 'stylesheet' option in the yaml configuration file to add CSS file to be used.
66+
One or more additional stylesheets can be loaded to add or override style from the current theme. Use the 'stylesheet' option in the yaml configuration file to load your own CSS file.
4267

4368
```yml
4469
stylesheet:
4570
- "assets/custom.css"
4671
```
4772

48-
### customization exemple
73+
### Customization exemple
4974

5075
#### Max width modification
5176

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"dependencies": {
1313
"@fortawesome/fontawesome-free": "^6.5.2",
14-
"bulma": "^0.9.4",
14+
"bulma": "^1.0.1",
1515
"lodash.merge": "^4.6.2",
1616
"vue": "^3.4.26",
17-
"yaml": "^2.4.2"
17+
"yaml": "^2.4.5"
1818
},
1919
"devDependencies": {
2020
"@rushstack/eslint-patch": "^1.8.0",
@@ -29,5 +29,5 @@
2929
"vite-plugin-pwa": "^0.20.0"
3030
},
3131
"license": "Apache-2.0",
32-
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
32+
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
3333
}

pnpm-lock.yaml

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/additional-page.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ links:
2424
url: "https://www.wikipedia.org/"
2525

2626
services:
27-
- name: "More applications on another page!"
27+
- name: "More apps on another page!"
2828
icon: "fas fa-cloud"
2929
items:
3030
- name: "Awesome app on a second page!"

public/assets/config-demo.yml.dist

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,6 @@ footer: '<p>Created with <span class="has-text-danger">❤️</span> with <a hre
1212

1313
# Optional theme customization
1414
theme: default
15-
colors:
16-
light:
17-
highlight-primary: "#3367d6"
18-
highlight-secondary: "#4285f4"
19-
highlight-hover: "#5a95f5"
20-
background: "#f5f5f5"
21-
card-background: "#ffffff"
22-
text: "#363636"
23-
text-header: "#ffffff"
24-
text-title: "#303030"
25-
text-subtitle: "#424242"
26-
card-shadow: rgba(0, 0, 0, 0.1)
27-
link: "#3273dc"
28-
link-hover: "#363636"
29-
dark:
30-
highlight-primary: "#3367d6"
31-
highlight-secondary: "#4285f4"
32-
highlight-hover: "#5a95f5"
33-
background: "#131313"
34-
card-background: "#2b2b2b"
35-
text: "#eaeaea"
36-
text-header: "#ffffff"
37-
text-title: "#fafafa"
38-
text-subtitle: "#f5f5f5"
39-
card-shadow: rgba(0, 0, 0, 0.4)
40-
link: "#3273dc"
41-
link-hover: "#ffdd57"
4215

4316
columns: "3"
4417

@@ -97,7 +70,7 @@ services:
9770
- name: "Buy me a coffee!"
9871
subtitle: "Sponsor this project"
9972
icon: "fa-solid fa-mug-hot"
100-
url: "https://www.buymeacoffee.com/bastien"
73+
url: "https://www.buymeacoffee.com/bastien"
10174
- name: "Smart cards showcase"
10275
icon: "fa-solid fa-brain"
10376
items:
@@ -127,6 +100,8 @@ services:
127100
units: "metric"
128101
endpoint: "/dummy-data/openweather/weather"
129102
type: "OpenWeather"
103+
- name: "Change Theme"
104+
type: "ThemeChooser"
130105
- name: "Ressources"
131106
icon: "fa-regular fa-bookmark"
132107
items:

public/assets/config.yml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# Homepage configuration
3-
# See https://fontawesome.com/v5/search for icons options
3+
# See https://fontawesome.com/v6/search for icons options
44

55
title: "Demo dashboard"
66
subtitle: "Homer"
@@ -12,6 +12,9 @@ footer: '<p>Created with <span class="has-text-danger">❤️</span> with <a hre
1212

1313
# Optional theme customization
1414
theme: default
15+
16+
# Optional theme customization (color overrrides)
17+
# overrrides can also be done using CSS vars
1518
colors:
1619
light:
1720
highlight-primary: "#3367d6"

public/assets/config.yml.dist.sample-sui

Lines changed: 0 additions & 64 deletions
This file was deleted.
48.3 KB
Loading
43.6 KB
Loading

0 commit comments

Comments
 (0)