Skip to content

Commit

Permalink
fix: fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 27, 2024
1 parent a454966 commit 961b453
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/src/client/color-switch/color-switch.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
all: unset;
position: relative;
box-shadow: none;
color: #aaa;
color: currentColor;
border-radius: 50%;
border: 1px dashed gray;
border: 1px dashed currentColor;
cursor: pointer;
--s: 25px;
height: var(--s);
Expand All @@ -23,6 +23,7 @@
display: flex;
align-items: center;
justify-content: center;
opacity: 0.5;
content: "A";
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/client/switcher/switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let updateForcedState: UpdateForcedPropsFunc;
const modifyTransition = (themeTransition = "none") => {
const css = document.createElement("style");
/** split by ';' to prevent CSS injection */
css.textContent = `transition: ${themeTransition.split(";")[0]} !important;`;
css.textContent = `transition:${themeTransition.split(";")[0]}!important;`;
document.head.appendChild(css);

return () => {
Expand Down
5 changes: 2 additions & 3 deletions lib/src/hooks/use-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ export const useTheme = (targetSelector?: string): UseThemeYield => {
if (index === -1 || (skipSystem && index === len - 1)) index = 0;
setter("c")(colorSchemes[(index + 1) % len]);
},
setForcedColorScheme: forcedColorScheme =>
setForcedState(state => ({ ...state, fc: forcedColorScheme })),
setForcedTheme: forcedTheme => setForcedState(state => ({ ...state, f: forcedTheme })),
setForcedColorScheme: fc => setForcedState(state => ({ ...state, fc })),
setForcedTheme: f => setForcedState(state => ({ ...state, f })),
};

if (resolveTheme) {
Expand Down

0 comments on commit 961b453

Please sign in to comment.