|
| 1 | +:root { |
| 2 | + color-scheme: light dark; |
| 3 | +} |
| 4 | + |
1 | 5 | body { font: 12px Verdana, sans-serif; color: #484848; padding: 0; margin: 0; } |
2 | 6 | input, button, a.button { font: 12px Verdana, sans-serif; } |
3 | 7 |
|
@@ -428,3 +432,90 @@ input.toggle:checked + label.toggle:after { |
428 | 432 | .yellow-background { |
429 | 433 | background-color: #ffff7b; |
430 | 434 | } |
| 435 | + |
| 436 | +/* Theme switcher */ |
| 437 | + |
| 438 | +.switcher { |
| 439 | + height: 32px; |
| 440 | + width: 96px; |
| 441 | + position: relative; |
| 442 | + margin: 2px; |
| 443 | + margin-left: -50px; |
| 444 | + padding: 2px; |
| 445 | + display: grid; |
| 446 | + grid-template-columns: 1fr 1fr 1fr; |
| 447 | + border: none; |
| 448 | +} |
| 449 | + |
| 450 | +/* Theme switcher legend */ |
| 451 | + |
| 452 | +.switcher__legend { |
| 453 | + position: absolute; |
| 454 | + opacity: 0; |
| 455 | + pointer-events: none; |
| 456 | +} |
| 457 | + |
| 458 | +/* Theme switcher radio */ |
| 459 | + |
| 460 | +.switcher__radio { |
| 461 | + -webkit-appearance: none; |
| 462 | + appearance: none; |
| 463 | + margin: 0; |
| 464 | + width: 32px; |
| 465 | + height: 32px; |
| 466 | + background-position: center; |
| 467 | + background-repeat: no-repeat; |
| 468 | + background-size: 24px; |
| 469 | + transition: filter 0.1s ease-in; |
| 470 | +} |
| 471 | + |
| 472 | +.switcher__radio:focus { |
| 473 | + outline: none; |
| 474 | +} |
| 475 | + |
| 476 | +.switcher__radio--light { |
| 477 | + background-image: url('../ing/light.svg'); |
| 478 | +} |
| 479 | + |
| 480 | +.switcher__radio--auto { |
| 481 | + background-image: url('../ing/auto.svg'); |
| 482 | +} |
| 483 | + |
| 484 | +.switcher__radio--dark { |
| 485 | + background-image: url('../img/dark.svg'); |
| 486 | +} |
| 487 | + |
| 488 | +/* Switcher status */ |
| 489 | + |
| 490 | +.switcher__status { |
| 491 | + position: absolute; |
| 492 | + top: 0; |
| 493 | + right: 0; |
| 494 | + bottom: 0; |
| 495 | + left: 0; |
| 496 | + z-index: -1; |
| 497 | + box-shadow: 0 0 0 2px rgb(0 0 0 /0.2); |
| 498 | + border-radius: 18px; |
| 499 | + background-color: rgb(255 255 255 / 0.5); |
| 500 | + background-repeat: no-repeat; |
| 501 | + background-image: url('../ing/status.svg'); |
| 502 | + background-size: 32px; |
| 503 | + background-position: center; |
| 504 | + transition: background-position 0.1s ease-in; |
| 505 | +} |
| 506 | + |
| 507 | +.switcher__radio:focus-visible ~ .switcher__status { |
| 508 | + box-shadow: 0 0 0 2px black; |
| 509 | +} |
| 510 | + |
| 511 | +.switcher__radio--light:checked ~ .switcher__status { |
| 512 | + background-position: left 2px center; |
| 513 | +} |
| 514 | + |
| 515 | +.switcher__radio--auto:checked ~ .switcher__status { |
| 516 | + background-position: center center; |
| 517 | +} |
| 518 | + |
| 519 | +.switcher__radio--dark:checked ~ .switcher__status { |
| 520 | + background-position: right 2px center; |
| 521 | +} |
0 commit comments