| 1 |
.darkify_switch_style.switch-orbit { |
| 2 |
/* `!important` + `flex: none`: the switch can render inside a container the |
| 3 |
theme controls (a nav `<li>`, a widget area), which — unlike a page's |
| 4 |
content wrapper — often puts a `display:flex` and/or `width:100%`/`flex:1` |
| 5 |
on its children for its own layout. Without pinning this pill's intrinsic |
| 6 |
size, that ancestor stretches it into a full-width bar (the `.toggle-track` |
| 7 |
below then fills 100% of THAT, i.e. the whole stretched box). */ |
| 8 |
width: calc(70px * var(--darkify-switch-scale, 1)) !important; |
| 9 |
height: calc(30px * var(--darkify-switch-scale, 1)) !important; |
| 10 |
flex: none !important; |
| 11 |
box-sizing: content-box !important; |
| 12 |
} |
| 13 |
|
| 14 |
.darkify_switch_style.switch-orbit .theme-toggle { |
| 15 |
display: inherit; |
| 16 |
width: 100% !important; |
| 17 |
height: 100% !important; |
| 18 |
flex: none !important; |
| 19 |
} |
| 20 |
.darkify_switch_style.switch-orbit .toggle-track { |
| 21 |
display: flex; |
| 22 |
align-items: center; |
| 23 |
justify-content: space-between; |
| 24 |
width: 100% !important; |
| 25 |
height: 100% !important; |
| 26 |
position: relative; |
| 27 |
} |
| 28 |
|
| 29 |
.darkify_switch_style.switch-orbit .theme-toggle svg { |
| 30 |
width: calc(20px * var(--darkify-switch-scale, 1)); |
| 31 |
height: calc(20px * var(--darkify-switch-scale, 1)); |
| 32 |
fill: var(--darkify_switch_light_mode_color); |
| 33 |
} |
| 34 |
.darkify_switch_style.switch-orbit .theme-toggle .toggle-sun svg { |
| 35 |
fill: var(--darkify_switch_dark_mode_color); |
| 36 |
} |
| 37 |
.darkify_switch_style.switch-orbit .toggle-sun, |
| 38 |
.darkify_switch_style.switch-orbit .toggle-moon { |
| 39 |
display: flex; |
| 40 |
align-items: center; |
| 41 |
justify-content: center; |
| 42 |
z-index: 9; |
| 43 |
padding: 0 calc(8px * var(--darkify-switch-scale, 1)); |
| 44 |
border-radius: 50%; |
| 45 |
} |
| 46 |
.darkify_switch_style.switch-orbit .toggle-thumb { |
| 47 |
position: absolute; |
| 48 |
width: calc(24px * var(--darkify-switch-scale, 1)); |
| 49 |
height: calc(24px * var(--darkify-switch-scale, 1)); |
| 50 |
margin: 0 calc(6px * var(--darkify-switch-scale, 1)); |
| 51 |
background-color: var(--darkify_switch_dark_mode_bg); |
| 52 |
border-radius: 50%; |
| 53 |
transition-duration: 0.3s; |
| 54 |
transition-property: all; |
| 55 |
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); |
| 56 |
} |
| 57 |
.darkify_dark_mode_enabled .darkify_switch_style.switch-orbit .toggle-thumb { |
| 58 |
background-color: var(--darkify_switch_light_mode_bg); |
| 59 |
transform: translateX(calc(100% - -13px * var(--darkify-switch-scale, 1))) |
| 60 |
scale(1); |
| 61 |
} |
| 62 |
|