fix(theme): switch thumb travels inside the track, toggle scene for the preview

This commit is contained in:
hh
2026-08-29 19:42:59 +02:00
parent 353ee143f6
commit b619c75119
2 changed files with 20 additions and 7 deletions
+15 -6
View File
@@ -360,18 +360,23 @@
.beaver-root [data-slot="select-content"]::before {
display: none !important;
}
/* Obsidian's own toggle: border-hover track, accent when on, a white thumb. */
.beaver-root [data-slot="switch"] {
/* Obsidian's own toggle: border-hover track, accent when on, a white thumb.
Tripled class: luma's group/data variants carry three classes' worth of
specificity, and the utilities are all !important. */
.beaver-root.beaver-root.beaver-root [data-slot="switch"] {
justify-content: flex-start !important;
width: 40px !important;
height: 20px !important;
padding: 0 !important;
background: var(--background-modifier-border-hover) !important;
border: 0 !important;
border-radius: var(--toggle-radius, 18px) !important;
}
.beaver-root [data-slot="switch"][data-state="checked"] {
.beaver-root.beaver-root.beaver-root
[data-slot="switch"][data-state="checked"] {
background: var(--interactive-accent) !important;
}
.beaver-root [data-slot="switch-thumb"] {
.beaver-root.beaver-root.beaver-root [data-slot="switch-thumb"] {
display: block !important;
width: 16px !important;
height: 16px !important;
@@ -380,8 +385,12 @@
border-radius: 50% !important;
box-shadow: var(--shadow-s) !important;
}
.beaver-root [data-slot="switch-thumb"][data-state="checked"] {
transform: translateX(20px) !important;
.beaver-root.beaver-root.beaver-root [data-slot="switch-thumb"] {
translate: 0 !important;
}
.beaver-root.beaver-root.beaver-root
[data-slot="switch-thumb"][data-state="checked"] {
translate: 20px 0 !important;
}
.beaver-root [data-slot="button"][data-variant="default"],
.beaver-root [data-slot="button"]:not([class*="bg-"]) {