mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-21 19:32:34 +00:00
Support dark mode for note tags in modern style (#828)
This commit is contained in:
parent
1b2b4f21fd
commit
1b8522031c
@ -85,6 +85,24 @@ if (hexo-config('note.style') != 'disabled') {
|
|||||||
color: $note-modern-hover[$type];
|
color: $note-modern-hover[$type];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hexo-config('darkmode')) {
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
background: $note-modern-bg-dark[$type];
|
||||||
|
border-color: $note-modern-border-dark[$type];
|
||||||
|
color: $note-modern-text-dark[$type];
|
||||||
|
|
||||||
|
a:not(.btn) {
|
||||||
|
border-bottom-color: $note-modern-text-dark[$type];
|
||||||
|
color: $note-modern-text-dark[$type];
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-bottom-color: $note-modern-hover-dark[$type];
|
||||||
|
color: $note-modern-hover-dark[$type];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($note-style != 'modern') {
|
if ($note-style != 'modern') {
|
||||||
|
|||||||
@ -374,6 +374,19 @@ $note-modern-hover = {
|
|||||||
danger : darken(spin($note-modern-text.danger, -10), 22%)
|
danger : darken(spin($note-modern-text.danger, -10), 22%)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
transform-map(map, transform) {
|
||||||
|
new-map = {
|
||||||
|
}
|
||||||
|
for key, val in map {
|
||||||
|
new-map[key] = transform(val);
|
||||||
|
}
|
||||||
|
return new-map;
|
||||||
|
}
|
||||||
|
|
||||||
|
$note-modern-border-dark = transform-map($note-modern-hover, @(val) { lighten(val, 10%) });
|
||||||
|
$note-modern-bg-dark = transform-map($note-modern-text, @(val) { desaturate(darken(val, 20%), 20%) });
|
||||||
|
$note-modern-text-dark = transform-map($note-modern-bg, @(val) { darken(val, 10%) });
|
||||||
|
$note-modern-hover-dark = transform-map($note-modern-border, @(val) { lighten(val, 75%) });
|
||||||
|
|
||||||
// Tabs border radius
|
// Tabs border radius
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user