Skip to content

Commit

Permalink
docs(changeset): Fix color-switch styles in containerized styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 27, 2024
1 parent eedf0eb commit 6e02178
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-beers-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-themes": patch
---

Fix color-switch styles in containerized styles.
12 changes: 3 additions & 9 deletions lib/src/client/color-switch/color-switch.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
transition: all 0.3s ease-in-out 0s !important;
}

[data-csp="system"] .s::after,
[data-csp="system"] ~ .s::after,
[data-csp="system"] ~ * .s::after {
.system.s::after {
position: absolute;
height: 100%;
width: 100%;
Expand All @@ -28,18 +26,14 @@
content: "A";
}

[data-csp="dark"] .s,
[data-csp="dark"] ~ .s,
[data-csp="dark"] ~ * .s {
.dark.s {
box-shadow: calc(var(--s) / 4) calc(var(--s) / -4) calc(var(--s) / 8) inset #fff;
border: none;
background: transparent;
animation: a linear 0.5s;
}

[data-csp="light"] .s,
[data-csp="light"] ~ .s,
[data-csp="light"] ~ * .s {
.light.s {
box-shadow: 0 0 50px 10px yellow;
background-color: yellow;
border: 1px solid orangered;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/client/color-switch/color-switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export const ColorSwitch = ({
className,
...props
}: ColorSwitchProps) => {
const { toggleColorScheme } = useTheme(targetSelector);
const { toggleColorScheme, colorSchemePref } = useTheme(targetSelector);

const cls = [styles.s, className].join(" ");
const cls = [styles.s, styles[colorSchemePref], className].join(" ");
return (
<button
className={cls}
Expand Down
2 changes: 1 addition & 1 deletion scripts/manual-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const OLD_VERSION = pkg.version;

if (!isLatestRelease) {
/** pre-release branch name should be the tag name (e.g., beta, canery, etc.) or tag name followed by a '-' and version or other specifiers. e.g. beta-2.0 */
tag = BRANCH.split("-")[0];
tag = BRANCH.split("-")[0].replace("/", "_");
try {
execSync(`pnpm changeset pre enter ${tag}`);
} catch (e) {
Expand Down

0 comments on commit 6e02178

Please sign in to comment.