Add: SASS - default theme mixins

This commit is contained in:
alstjr7375 2022-03-22 05:03:44 +09:00
parent 1035b88253
commit 6e652bea49
2 changed files with 112 additions and 1 deletions

View file

@ -1,12 +1,29 @@
@use "sass:selector";
$_lightdark: "[lwtheme-mozlightdark]"; /* Legacy - FF v96 */
$_lwTheme: ":-moz-lwtheme";
$_lightdark: "[lwtheme-mozlightdark]"; // Legacy - FF v96
$_lightText: '[lwthemetextcolor="bright"]';
$_darkText: ":not(#{$_lightText})";
$_sysDark: "[lwt-default-theme-in-dark-mode]";
$_lightStyle: '[style*="--lwt-accent-color: rgb(240, 240, 244); --lwt-text-color: rgba(21, 20, 26);"]';
$_darkStyle: '[style*="--lwt-accent-color: rgb(28, 27, 34); --lwt-text-color: rgba(251, 251, 254);"]';
@function built-in-default-theme() {
$oldDefault: selector.append(":root", $_lightdark);
$newDefault: selector.append(":root", ":is(#{$_lightStyle}, #{$_darkStyle})");
@return "#{$oldDefault}, #{$newDefault}";
}
@function system-default-theme() {
$sysLight: selector.append(":root", ":not(#{$_lwTheme})");
$sysDark: selector.append(":root", $_sysDark);
@return "#{$sysLight}, #{$sysDark}";
}
@function built-in-light-theme() {
$oldLight: selector.append(":root", $_lightdark, $_darkText);
$newLight: selector.append(":root", $_lightStyle);