Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scss/_settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ $enable-transitions: true !default;
// Enable overriding with !important
$enable-important: true !default;

// Enable dark mode
// Light-only mode if disabled
$enable-dark-mode: true !default;

// Optional parent selector
// If defined, all HTML tags are wrapped with this selector
// :root is not wrapped
Expand Down
6 changes: 6 additions & 0 deletions scss/pico.classless.light.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Pico classless light-only version
@use "index" with (
$enable-semantic-container: true,
$enable-classes: false,
$enable-dark-mode: false
);
44 changes: 26 additions & 18 deletions scss/themes/default/_schemes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,35 @@
* Color schemes
*/

// Light color scheme (Default)
// Can be forced with data-theme="light"
[data-theme="light"],
:root:not([data-theme="dark"]),
:host(:not([data-theme="dark"])) {
@include light.theme;
}
@if $enable-dark-mode {
// Light color scheme (Default)
// Can be forced with data-theme="light"
[data-theme="light"],
:root:not([data-theme="dark"]),
:host(:not([data-theme="dark"])) {
@include light.theme;
}

// Dark color scheme (Auto)
// Automatically enabled if user has Dark mode enabled
@media only screen and (prefers-color-scheme: dark) {
:root:not([data-theme]),
:host(:not([data-theme])) {
@include dark.theme;
// Dark color scheme (Auto)
// Automatically enabled if user has Dark mode enabled
@media only screen and (prefers-color-scheme: dark) {
:root:not([data-theme]),
:host(:not([data-theme])) {
@include dark.theme;
}
}
}

// Dark color scheme (Forced)
// Enabled if forced with data-theme="dark"
[data-theme="dark"] {
@include dark.theme;
// Dark color scheme (Forced)
// Enabled if forced with data-theme="dark"
[data-theme="dark"] {
@include dark.theme;
}
} @else {
// Light-only mode
:root,
:host {
@include light.theme;
}
}

#{$parent-selector} progress,
Expand Down