feat: Add basic theme feature

This commit is contained in:
JY Hsu 2024-09-01 00:38:50 +08:00
parent 8c6aa5ac09
commit dd1ede93d9
3 changed files with 105 additions and 1 deletions

View file

@ -69,15 +69,24 @@ params:
# id: foo
# name: bar
# The `darkMode` feature
# The `darkMode` feature. It's a deprecated setting but keep backward compatibility
darkmode:
enable: true
# Configure theme settings
theme:
enable: true
services:
light: true # enable light theme. default "true"
dark: true # enable dark theme. default "true"
defaultTheme: light # can be either light, dark or system. default "system"
This helper will convert the above config into the following env vars:
* `FEATURE_ANALYTICS=1`
* `FEATURE_ANALYTICS_GOOGLE=1`
* `FEATURE_DARKMODE=1`
* `FEATURE_THEME=1`
In JS, you can use it like this: