Narrow dark mode selectors

This commit is contained in:
Ronan Berder
2026-06-25 18:15:35 +08:00
parent 4942a79c95
commit 7cd8a09de3
10 changed files with 21 additions and 17 deletions
+4
View File
@@ -2,6 +2,10 @@
## Unreleased
### Changed
- Narrowed dark-mode generated selectors to `html.dark` to reduce broad style recalculation work.
## [1.0.0-beta.7] - 2026-06-25
### Added
+1 -1
View File
@@ -1,4 +1,4 @@
@custom-variant dark (&:is(.dark *));
@custom-variant dark (&:is(html.dark *));
:root {
--radius: 0.625rem;
+2 -2
View File
@@ -803,11 +803,11 @@
@apply bg-background rounded-full shadow-sm not-dark:bg-clip-padding;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}
+2 -2
View File
@@ -800,11 +800,11 @@
@apply bg-background rounded-full;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}
+2 -2
View File
@@ -791,11 +791,11 @@
@apply bg-background rounded-full;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}
+2 -2
View File
@@ -795,11 +795,11 @@
@apply bg-background rounded-full;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}
+2 -2
View File
@@ -808,11 +808,11 @@
@apply bg-background rounded-full;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}
+2 -2
View File
@@ -803,11 +803,11 @@
@apply bg-background rounded-2xl shadow-sm not-dark:bg-clip-padding;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}
+2 -2
View File
@@ -824,11 +824,11 @@
@apply bg-background;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}
+2 -2
View File
@@ -808,11 +808,11 @@
@apply bg-background rounded-full;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not(:checked):before {
@apply bg-foreground;
}
.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
html.dark :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):checked:before {
@apply bg-primary-foreground;
}