Skip to content

Commit

Permalink
docs(changeset): Minify CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 24, 2024
1 parent 839fa3f commit c21dd8f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-eggs-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-themes": patch
---

Minify CSS
24 changes: 12 additions & 12 deletions lib/src/client/color-switch/color-switch.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.color-switch {
.s {
all: unset;
position: relative;
box-shadow: none;
Expand All @@ -12,9 +12,9 @@
transition: all 0.3s ease-in-out 0s !important;
}

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

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

[data-csp="light"] .color-switch,
[data-csp="light"] ~ .color-switch,
[data-csp="light"] ~ * .color-switch {
[data-csp="light"] .s,
[data-csp="light"] ~ .s,
[data-csp="light"] ~ * .s {
box-shadow: 0 0 50px 10px yellow;
background-color: yellow;
border: 1px solid orangered;
}

@keyframes swing {
@keyframes a {
40% {
transform: rotate(-15deg);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig(
minify: !options.watch,
esbuildPlugins: [
react18Plugin({ disableJSXRequireDedup: true }),
cssPlugin({ generateScopedName: "nextjs-themes--[local]" }),
cssPlugin({ generateScopedName: "nth-[local]" }),
rdiPlugin(),
],
...options,
Expand Down

0 comments on commit c21dd8f

Please sign in to comment.