mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2026-06-25 17:28:44 +00:00
feat(theme): persist user theme preferences (#2756)
- Migrate theme persistence from `sessionStorage` to `localStorage` - Rename theme HTML attribute to `data-bs-theme` for Bootstrap compatibility - Trim and compile CSS according to the chosen theme mode
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
@mixin color-scheme($mode) {
|
||||
@media (prefers-color-scheme: #{$mode}) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin text-ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -28,3 +28,9 @@ $code-icon-width: 1.75rem !default;
|
||||
|
||||
$font-family-base: 'Source Sans Pro', 'Microsoft Yahei', sans-serif !default;
|
||||
$font-family-heading: Lato, 'Microsoft Yahei', sans-serif !default;
|
||||
|
||||
/* Theme mode settings */
|
||||
|
||||
$theme-attr: 'data-bs-theme'; /* the attribute used to indicate the resolved theme */
|
||||
$theme-options: light, dark;
|
||||
$theme: null !default; /* set by Jekyll site configuration */
|
||||
|
||||
Reference in New Issue
Block a user