Skip to content

Commit

Permalink
use data attr color mode selector instead of class for better compati…
Browse files Browse the repository at this point in the history
…bility with chakra
  • Loading branch information
pettinarip committed Sep 20, 2024
1 parent 23f68a8 commit b8b5c1d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ThemeProvider = ({ children }: Pick<ThemeProviderProps, "children">) => {
const theme = useMemo(() => merge(customTheme, { direction }), [direction])
return (
<NextThemesProvider
attribute="class"
attribute="data-theme"
defaultTheme="light"
enableSystem={false}
disableTransitionOnChange
Expand Down
4 changes: 2 additions & 2 deletions src/styles/docsearch.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}

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

.DocSearch-Search-Icon,
Expand Down Expand Up @@ -39,7 +39,7 @@
--docsearch-hit-height: fit-content;
}

.dark {
[data-theme="dark"] {
--docsearch-modal-background: theme(backgroundColor.background.DEFAULT);
--docsearch-highlight-color: theme(colors.primary.hover);
}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
--search-background: var(--background);
}

.dark {
[data-theme="dark"] {
/* Semantic Colors: Dark mode */
/* ! Deprecating primary-light */
--primary-light: hsla(var(--orange-100));
Expand Down
2 changes: 1 addition & 1 deletion src/styles/semantic-tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
}

/* Dark mode token declarations */
.dark {
[data-theme="dark"] {
--body: var(--gray-100);
--body-medium: var(--gray-400);
--body-light: var(--gray-600);
Expand Down

0 comments on commit b8b5c1d

Please sign in to comment.