diff --git a/README.md b/README.md index ce25bc6..ee87e0a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ ![light theme](figs/light.png) +## `auto` + +Switches between `dark` and `light` automatically based on the user's system preference. + ## Usage 1. Clone this repo @@ -20,7 +24,7 @@ ```ini [ui] -THEMES=...,dark,light +THEMES=...,dark,light,auto DEFAULT_THEME=dark # optional ``` diff --git a/dist/public/assets/css/theme-auto.css b/dist/public/assets/css/theme-auto.css new file mode 100644 index 0000000..a8d0513 --- /dev/null +++ b/dist/public/assets/css/theme-auto.css @@ -0,0 +1 @@ +@import "./theme-light.css"(prefers-color-scheme:light);@import "./theme-dark.css"(prefers-color-scheme:dark); \ No newline at end of file diff --git a/src/themes/scss/auto.scss b/src/themes/scss/auto.scss new file mode 100644 index 0000000..77aaa37 --- /dev/null +++ b/src/themes/scss/auto.scss @@ -0,0 +1,2 @@ +@import "./theme-light.css" (prefers-color-scheme: light); +@import "./theme-dark.css" (prefers-color-scheme: dark); \ No newline at end of file