Skip to content

Commit b8b5c1d

Browse files
committed
use data attr color mode selector instead of class for better compatibility with chakra
1 parent 23f68a8 commit b8b5c1d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/components/ThemeProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const ThemeProvider = ({ children }: Pick<ThemeProviderProps, "children">) => {
2727
const theme = useMemo(() => merge(customTheme, { direction }), [direction])
2828
return (
2929
<NextThemesProvider
30-
attribute="class"
30+
attribute="data-theme"
3131
defaultTheme="light"
3232
enableSystem={false}
3333
disableTransitionOnChange

src/styles/docsearch.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88

99
.DocSearch-Button-Container svg {
10-
@apply size-3.5 group-hover:rotate-12 transition-transform duration-500 group-hover:transition-transform group-hover:duration-500;
10+
@apply size-3.5 transition-transform duration-500 group-hover:rotate-12 group-hover:transition-transform group-hover:duration-500;
1111
}
1212

1313
.DocSearch-Search-Icon,
@@ -39,7 +39,7 @@
3939
--docsearch-hit-height: fit-content;
4040
}
4141

42-
.dark {
42+
[data-theme="dark"] {
4343
--docsearch-modal-background: theme(backgroundColor.background.DEFAULT);
4444
--docsearch-highlight-color: theme(colors.primary.hover);
4545
}

src/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
--search-background: var(--background);
5252
}
5353

54-
.dark {
54+
[data-theme="dark"] {
5555
/* Semantic Colors: Dark mode */
5656
/* ! Deprecating primary-light */
5757
--primary-light: hsla(var(--orange-100));

src/styles/semantic-tokens.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
}
123123

124124
/* Dark mode token declarations */
125-
.dark {
125+
[data-theme="dark"] {
126126
--body: var(--gray-100);
127127
--body-medium: var(--gray-400);
128128
--body-light: var(--gray-600);

0 commit comments

Comments
 (0)