feat: detect auto mode

This commit is contained in:
EnixCoda 2020-12-10 22:22:44 +08:00
parent 4c9ebc414b
commit d1197a5068
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -1,6 +1,6 @@
@use './variables.scss' as variables;
:root[data-color-mode='dark'] {
@mixin assign {
--gitako-auto-black: #{variables.$auto-black};
--gitako-auto-white: #{variables.$auto-white};
--gitako-auto-gray-0: #{variables.$auto-gray-0};
@ -566,3 +566,14 @@
--gitako-ansi-cyan: #{variables.$ansi-cyan};
--gitako-ansi-cyan-bright: #{variables.$ansi-cyan-bright};
}
// How to merge the selectors?
// Is it possible to not have two copy of dark theme variables?
@media (prefers-color-scheme: dark) {
:root[data-color-mode='auto'] {
@include assign();
}
}
:root[data-color-mode='dark'] {
@include assign();
}