Skip to content

Commit d3dd56e

Browse files
committed
fix: make card support darkmode change
1 parent 2df06b6 commit d3dd56e

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

_site/scss/components/_card.scss

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,23 @@
5353
}
5454
}
5555

56-
@media (prefers-color-scheme: dark) {
57-
.card {
58-
background-color: hsl(0, 0%, 16%);
59-
60-
> figcaption {
61-
border-block-start: 1px solid hsl(0, 0%, 20%);
62-
}
56+
@mixin darkmode {
57+
background-color: hsl(0, 0%, 16%);
58+
> figcaption {
59+
border-block-start: 1px solid hsl(0, 0%, 20%);
6360
}
64-
6561
.card__vertical-container {
6662
border-color: hsl(0, 0%, 20%);
6763
}
6864
}
65+
66+
.card {
67+
[data-darkmode="dark"] & {
68+
@include darkmode();
69+
}
70+
@media (prefers-color-scheme: dark) {
71+
[data-darkmode="auto"] & {
72+
@include darkmode();
73+
}
74+
}
75+
}

0 commit comments

Comments
 (0)