|
43 | 43 | --vcolor-controlActivated: var(--mistica-color-controlActivatedInverse); |
44 | 44 | --vcolor-checkbox-tick: var(--mistica-color-controlKnobInverse); |
45 | 45 | --vcolor-checkbox-background: transparent; |
| 46 | + |
| 47 | + --vcolor-switch-trackBackground: transparent; |
| 48 | + --vcolor-switch-handleChecked: var(--mistica-color-controlKnobInverse); |
| 49 | + --vcolor-switch-handleHover: var(--mistica-color-inverse); |
46 | 50 | } |
47 | 51 |
|
48 | 52 | [data-mistica-skin] > *, |
|
92 | 96 | --vcolor-controlActivated: var(--mistica-color-controlActivated); |
93 | 97 | --vcolor-checkbox-tick: var(--mistica-color-inverse); |
94 | 98 | --vcolor-checkbox-background: var(--mistica-color-background); |
| 99 | + |
| 100 | + --vcolor-switch-trackBackground: var(--mistica-color-backgroundAlternative); |
| 101 | + --vcolor-switch-handleChecked: var(--mistica-color-inverse); |
| 102 | + --vcolor-switch-handleHover: var(--mistica-color-neutralHigh); |
95 | 103 | } |
96 | 104 |
|
97 | 105 | @media (prefers-color-scheme: dark) { |
@@ -931,6 +939,10 @@ button.mistica-display-card:has(.mistica-card__media):active:after { |
931 | 939 | transition: background-color 0.1s ease-in-out; |
932 | 940 | } |
933 | 941 |
|
| 942 | +.mistica-accordion-item__summary::-webkit-details-marker { |
| 943 | + display: none; |
| 944 | +} |
| 945 | + |
934 | 946 | .mistica-accordion-item__summary-body { |
935 | 947 | display: flex; |
936 | 948 | flex-direction: column; |
@@ -1200,6 +1212,88 @@ button.mistica-display-card:has(.mistica-card__media):active:after { |
1200 | 1212 | } |
1201 | 1213 | } |
1202 | 1214 |
|
| 1215 | +/* Switch */ |
| 1216 | +.mistica-switch { |
| 1217 | + --switch-border-width: 2px; |
| 1218 | + --switch-transition: 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275); |
| 1219 | + appearance: none; |
| 1220 | + position: relative; |
| 1221 | + width: 52px; |
| 1222 | + height: 32px; |
| 1223 | + border-radius: 16px; |
| 1224 | + background-color: var(--vcolor-switch-trackBackground); |
| 1225 | + border: var(--switch-border-width) solid var(--vcolor-control); |
| 1226 | + padding: 0; |
| 1227 | + margin: 0; |
| 1228 | + box-sizing: border-box; |
| 1229 | + cursor: pointer; |
| 1230 | + transition: |
| 1231 | + background-color var(--switch-transition), |
| 1232 | + border-color var(--switch-transition); |
| 1233 | +} |
| 1234 | + |
| 1235 | +/* :after is the switch handle (bolita) */ |
| 1236 | +.mistica-switch:after { |
| 1237 | + content: ''; |
| 1238 | + position: absolute; |
| 1239 | + top: calc(8px - var(--switch-border-width)); |
| 1240 | + left: calc(8px - var(--switch-border-width)); |
| 1241 | + width: 16px; |
| 1242 | + height: 16px; |
| 1243 | + border-radius: 50%; |
| 1244 | + background-color: var(--vcolor-control); |
| 1245 | + transition: |
| 1246 | + transform var(--switch-transition), |
| 1247 | + background-color var(--switch-transition); |
| 1248 | +} |
| 1249 | + |
| 1250 | +.mistica-switch:hover:after { |
| 1251 | + background-color: var(--vcolor-switch-handleHover); |
| 1252 | +} |
| 1253 | + |
| 1254 | +.mistica-switch:checked { |
| 1255 | + background-color: var(--vcolor-controlActivated); |
| 1256 | + border-color: var(--vcolor-controlActivated); |
| 1257 | +} |
| 1258 | +.mistica-switch:checked:after { |
| 1259 | + background-color: var(--vcolor-switch-handleChecked); |
| 1260 | + transform: translateX(20px) scale(1.5); |
| 1261 | +} |
| 1262 | + |
| 1263 | +.mistica-switch:active:after { |
| 1264 | + transform: scale(1.75); |
| 1265 | +} |
| 1266 | +.mistica-switch:checked:active:after { |
| 1267 | + transform: translateX(20px) scale(1.75); |
| 1268 | +} |
| 1269 | + |
| 1270 | +/* :before is the ripple effect overlay on hover */ |
| 1271 | +.mistica-switch:before { |
| 1272 | + content: ''; |
| 1273 | + position: absolute; |
| 1274 | + top: calc(-8px + var(--switch-border-width)); |
| 1275 | + left: calc(-8px + var(--switch-border-width)); |
| 1276 | + width: 40px; |
| 1277 | + height: 40px; |
| 1278 | + border-radius: 50%; |
| 1279 | + background-color: transparent; |
| 1280 | + transition: |
| 1281 | + transform var(--switch-transition), |
| 1282 | + background-color var(--switch-transition); |
| 1283 | +} |
| 1284 | + |
| 1285 | +.mistica-switch:checked:before { |
| 1286 | + transform: translateX(20px); |
| 1287 | +} |
| 1288 | + |
| 1289 | +.mistica-switch:hover:before { |
| 1290 | + background-color: var(--mistica-color-backgroundContainerHover); |
| 1291 | +} |
| 1292 | + |
| 1293 | +.mistica-switch:active:before { |
| 1294 | + background-color: var(--mistica-color-backgroundContainerPressed); |
| 1295 | +} |
| 1296 | + |
1203 | 1297 | /* Checkbox */ |
1204 | 1298 | .mistica-checkbox { |
1205 | 1299 | appearance: none; |
|
0 commit comments