@db-ux/core-components 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -483,18 +483,16 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
483
483
  * @param $data an object like (min:"sm", max:"lg") or (min: "sm")
484
484
  */
485
485
  /* stylelint-disable-next-line db-ux/use-spacings */
486
- .db-switch:active:not(:disabled, [aria-disabled=true]) > input::before {
486
+ .db-switch:not(:has(input:disabled)):has(input:active, > label:active, :is(label):active) input::before {
487
487
  inline-size: calc(calc(var(--db-icon-font-size)) - 0.125rem * 2 + var(--db-spacing-fixed-2xs));
488
488
  margin: 0;
489
489
  }
490
- .db-switch:active:not(:disabled, [aria-disabled=true]) > input:checked::before {
490
+ .db-switch:not(:has(input:disabled)):has(input:active, > label:active, :is(label):active) input:checked::before {
491
491
  block-size: calc(var(--db-icon-font-size) - 0.125rem * 2);
492
492
  }
493
493
 
494
494
  .db-switch {
495
495
  user-select: none;
496
- /* stylelint-disable-next-line at-rule-empty-line-before */
497
- /* stylelint-disable-next-line at-rule-empty-line-before */
498
496
  }
499
497
  .db-switch:has(input:required):is(label)::after,
500
498
  .db-switch:has(input:required) > label::after, .db-switch[data-required=true]:is(label)::after,
@@ -510,230 +508,6 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
510
508
  content: "*"/"";
511
509
  }
512
510
  }
513
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) .db-infotext {
514
- /* stylelint-disable-next-line at-rule-empty-line-before */
515
- }
516
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) .db-infotext[data-semantic=successful] {
517
- display: flex;
518
- }
519
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) .db-infotext:not([data-semantic]) {
520
- display: none;
521
- }
522
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]) {
523
- --db-adaptive-bg-basic-transparent-semi: var(
524
- --db-successful-bg-basic-transparent-semi-default
525
- );
526
- --db-adaptive-bg-basic-transparent-hovered: var(
527
- --db-successful-bg-basic-transparent-hovered
528
- );
529
- --db-adaptive-bg-basic-transparent-pressed: var(
530
- --db-successful-bg-basic-transparent-pressed
531
- );
532
- }
533
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not(:checked), .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):is([type=radio]) {
534
- --db-check-element-border-color: var(
535
- --db-successful-on-bg-basic-emphasis-70-default
536
- );
537
- }
538
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked {
539
- background-color: var(--db-successful-bg-inverted-contrast-high-default);
540
- color: var(--db-successful-on-bg-inverted-default);
541
- /* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
542
- }
543
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked::before, .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked::after {
544
- --db-icon-color: var(--db-successful-on-bg-inverted-default);
545
- }
546
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]) {
547
- cursor: var(--db-overwrite-cursor, pointer);
548
- background-color: var(--db-successful-bg-inverted-contrast-high-hovered);
549
- }
550
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input) {
551
- cursor: initial;
552
- }
553
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
554
- cursor: pointer;
555
- }
556
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]) {
557
- cursor: var(--db-overwrite-cursor, pointer);
558
- background-color: var(--db-successful-bg-inverted-contrast-high-pressed);
559
- }
560
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input) {
561
- cursor: initial;
562
- }
563
- .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input:not([data-custom-validity]):required:user-valid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
564
- cursor: pointer;
565
- }
566
- .db-switch:has(input:not([data-custom-validity]):required:user-valid):has(input:not([role=switch])):is(label),
567
- .db-switch:has(input:not([data-custom-validity]):required:user-valid):has(input:not([role=switch])) > label {
568
- color: var(--db-successful-on-bg-basic-emphasis-80-default);
569
- }
570
- .db-switch:has(input[data-custom-validity=valid]) .db-infotext, .db-switch[data-custom-validity=valid] .db-infotext {
571
- /* stylelint-disable-next-line at-rule-empty-line-before */
572
- }
573
- .db-switch:has(input[data-custom-validity=valid]) .db-infotext[data-semantic=successful], .db-switch[data-custom-validity=valid] .db-infotext[data-semantic=successful] {
574
- display: flex;
575
- }
576
- .db-switch:has(input[data-custom-validity=valid]) .db-infotext:not([data-semantic]), .db-switch[data-custom-validity=valid] .db-infotext:not([data-semantic]) {
577
- display: none;
578
- }
579
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]), .db-switch[data-custom-validity=valid] input:not([role=switch]) {
580
- --db-adaptive-bg-basic-transparent-semi: var(
581
- --db-successful-bg-basic-transparent-semi-default
582
- );
583
- --db-adaptive-bg-basic-transparent-hovered: var(
584
- --db-successful-bg-basic-transparent-hovered
585
- );
586
- --db-adaptive-bg-basic-transparent-pressed: var(
587
- --db-successful-bg-basic-transparent-pressed
588
- );
589
- }
590
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not(:checked), .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):is([type=radio]), .db-switch[data-custom-validity=valid] input:not([role=switch]):not(:checked), .db-switch[data-custom-validity=valid] input:not([role=switch]):is([type=radio]) {
591
- --db-check-element-border-color: var(
592
- --db-successful-on-bg-basic-emphasis-70-default
593
- );
594
- }
595
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked, .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked {
596
- background-color: var(--db-successful-bg-inverted-contrast-high-default);
597
- color: var(--db-successful-on-bg-inverted-default);
598
- /* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
599
- }
600
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked::before, .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked::after, .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked::before, .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked::after {
601
- --db-icon-color: var(--db-successful-on-bg-inverted-default);
602
- }
603
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]) {
604
- cursor: var(--db-overwrite-cursor, pointer);
605
- background-color: var(--db-successful-bg-inverted-contrast-high-hovered);
606
- }
607
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input) {
608
- cursor: initial;
609
- }
610
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
611
- cursor: pointer;
612
- }
613
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]) {
614
- cursor: var(--db-overwrite-cursor, pointer);
615
- background-color: var(--db-successful-bg-inverted-contrast-high-pressed);
616
- }
617
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input) {
618
- cursor: initial;
619
- }
620
- .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input[data-custom-validity=valid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch[data-custom-validity=valid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
621
- cursor: pointer;
622
- }
623
- .db-switch:has(input[data-custom-validity=valid]):has(input:not([role=switch])):is(label),
624
- .db-switch:has(input[data-custom-validity=valid]):has(input:not([role=switch])) > label, .db-switch[data-custom-validity=valid]:has(input:not([role=switch])):is(label),
625
- .db-switch[data-custom-validity=valid]:has(input:not([role=switch])) > label {
626
- color: var(--db-successful-on-bg-basic-emphasis-80-default);
627
- }
628
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) .db-infotext[data-semantic=critical] {
629
- display: flex;
630
- }
631
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) .db-infotext:not([data-semantic]) {
632
- display: none;
633
- }
634
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]) {
635
- --db-adaptive-bg-basic-transparent-semi: var(
636
- --db-critical-bg-basic-transparent-semi-default
637
- );
638
- --db-adaptive-bg-basic-transparent-hovered: var(
639
- --db-critical-bg-basic-transparent-hovered
640
- );
641
- --db-adaptive-bg-basic-transparent-pressed: var(
642
- --db-critical-bg-basic-transparent-pressed
643
- );
644
- }
645
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not(:checked), .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):is([type=radio]) {
646
- --db-check-element-border-color: var(
647
- --db-critical-on-bg-basic-emphasis-70-default
648
- );
649
- }
650
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked {
651
- background-color: var(--db-successful-bg-inverted-contrast-high-default);
652
- color: var(--db-successful-on-bg-inverted-default);
653
- /* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
654
- }
655
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked::before, .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked::after {
656
- --db-icon-color: var(--db-successful-on-bg-inverted-default);
657
- }
658
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]) {
659
- cursor: var(--db-overwrite-cursor, pointer);
660
- background-color: var(--db-successful-bg-inverted-contrast-high-hovered);
661
- }
662
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input) {
663
- cursor: initial;
664
- }
665
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
666
- cursor: pointer;
667
- }
668
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]) {
669
- cursor: var(--db-overwrite-cursor, pointer);
670
- background-color: var(--db-successful-bg-inverted-contrast-high-pressed);
671
- }
672
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input) {
673
- cursor: initial;
674
- }
675
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input:not([data-custom-validity]):required:user-invalid) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
676
- cursor: pointer;
677
- }
678
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid):has(input:not([role=switch])):is(label),
679
- .db-switch:has(input:not([data-custom-validity]):required:user-invalid):has(input:not([role=switch])) > label {
680
- color: var(--db-critical-on-bg-basic-emphasis-80-default);
681
- }
682
- .db-switch:has(input[data-custom-validity=invalid]) .db-infotext[data-semantic=critical], .db-switch[data-custom-validity=invalid] .db-infotext[data-semantic=critical] {
683
- display: flex;
684
- }
685
- .db-switch:has(input[data-custom-validity=invalid]) .db-infotext:not([data-semantic]), .db-switch[data-custom-validity=invalid] .db-infotext:not([data-semantic]) {
686
- display: none;
687
- }
688
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]), .db-switch[data-custom-validity=invalid] input:not([role=switch]) {
689
- --db-adaptive-bg-basic-transparent-semi: var(
690
- --db-critical-bg-basic-transparent-semi-default
691
- );
692
- --db-adaptive-bg-basic-transparent-hovered: var(
693
- --db-critical-bg-basic-transparent-hovered
694
- );
695
- --db-adaptive-bg-basic-transparent-pressed: var(
696
- --db-critical-bg-basic-transparent-pressed
697
- );
698
- }
699
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not(:checked), .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):is([type=radio]), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not(:checked), .db-switch[data-custom-validity=invalid] input:not([role=switch]):is([type=radio]) {
700
- --db-check-element-border-color: var(
701
- --db-critical-on-bg-basic-emphasis-70-default
702
- );
703
- }
704
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked, .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked {
705
- background-color: var(--db-successful-bg-inverted-contrast-high-default);
706
- color: var(--db-successful-on-bg-inverted-default);
707
- /* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
708
- }
709
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked::before, .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked::after, .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked::before, .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked::after {
710
- --db-icon-color: var(--db-successful-on-bg-inverted-default);
711
- }
712
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]) {
713
- cursor: var(--db-overwrite-cursor, pointer);
714
- background-color: var(--db-successful-bg-inverted-contrast-high-hovered);
715
- }
716
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input) {
717
- cursor: initial;
718
- }
719
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
720
- cursor: pointer;
721
- }
722
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]) {
723
- cursor: var(--db-overwrite-cursor, pointer);
724
- background-color: var(--db-successful-bg-inverted-contrast-high-pressed);
725
- }
726
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input) {
727
- cursor: initial;
728
- }
729
- .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:has(input[data-custom-validity=invalid]) input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch[data-custom-validity=invalid] input:not([role=switch]):not([type=radio]):checked:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
730
- cursor: pointer;
731
- }
732
- .db-switch:has(input[data-custom-validity=invalid]):has(input:not([role=switch])):is(label),
733
- .db-switch:has(input[data-custom-validity=invalid]):has(input:not([role=switch])) > label, .db-switch[data-custom-validity=invalid]:has(input:not([role=switch])):is(label),
734
- .db-switch[data-custom-validity=invalid]:has(input:not([role=switch])) > label {
735
- color: var(--db-critical-on-bg-basic-emphasis-80-default);
736
- }
737
511
  .db-switch:has(input:disabled) {
738
512
  opacity: 0.4;
739
513
  }
@@ -743,38 +517,7 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
743
517
  align-items: flex-start;
744
518
  position: relative;
745
519
  gap: var(--db-spacing-fixed-xs);
746
- }
747
- .db-switch:is(label):not(:has(input:disabled)),
748
- .db-switch > label:not(:has(input:disabled)) {
749
- /* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
750
- }
751
- .db-switch:is(label):not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]),
752
- .db-switch > label:not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]) {
753
- cursor: var(--db-overwrite-cursor, pointer);
754
- }
755
- .db-switch:is(label):not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:is(label):not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(input),
756
- .db-switch > label:not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(textarea),
757
- .db-switch > label:not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(input) {
758
- cursor: initial;
759
- }
760
- .db-switch:is(label):not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:is(label):not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)),
761
- .db-switch > label:not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]),
762
- .db-switch > label:not(:has(input:disabled)):hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
763
- cursor: pointer;
764
- }
765
- .db-switch:is(label):not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]),
766
- .db-switch > label:not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]) {
767
- cursor: var(--db-overwrite-cursor, pointer);
768
- }
769
- .db-switch:is(label):not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:is(label):not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(input),
770
- .db-switch > label:not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(textarea),
771
- .db-switch > label:not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(input) {
772
- cursor: initial;
773
- }
774
- .db-switch:is(label):not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:is(label):not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)),
775
- .db-switch > label:not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]),
776
- .db-switch > label:not(:has(input:disabled)):active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
777
- cursor: pointer;
520
+ color: var(--db-check-element-label-color, var(--db-adaptive-on-bg-basic-emphasis-100-default));
778
521
  }
779
522
  .db-switch input {
780
523
  background-color: var(--db-adaptive-bg-basic-transparent-full-default);
@@ -786,27 +529,6 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
786
529
  block-size: var(--db-icon-font-size);
787
530
  inline-size: var(--db-icon-font-size);
788
531
  padding: 0;
789
- /* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
790
- }
791
- .db-switch input:hover:not(:disabled, [aria-disabled=true]) {
792
- cursor: var(--db-overwrite-cursor, pointer);
793
- background-color: var(--db-adaptive-bg-basic-transparent-hovered);
794
- }
795
- .db-switch input:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch input:hover:not(:disabled, [aria-disabled=true]):is(input) {
796
- cursor: initial;
797
- }
798
- .db-switch input:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch input:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
799
- cursor: pointer;
800
- }
801
- .db-switch input:active:not(:disabled, [aria-disabled=true]) {
802
- cursor: var(--db-overwrite-cursor, pointer);
803
- background-color: var(--db-adaptive-bg-basic-transparent-pressed);
804
- }
805
- .db-switch input:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch input:active:not(:disabled, [aria-disabled=true]):is(input) {
806
- cursor: initial;
807
- }
808
- .db-switch input:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch input:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
809
- cursor: pointer;
810
532
  }
811
533
  .db-switch[data-size=small] input {
812
534
  margin-inline-end: var(--db-spacing-fixed-2xs);
@@ -817,14 +539,31 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
817
539
  .db-switch[data-hide-label=true] input {
818
540
  margin-inline-end: 0;
819
541
  }
820
- .db-switch:active:not(:disabled, [aria-disabled=true]) {
542
+ .db-switch:not(:has(input:disabled)):has(input:hover, > label:hover, :is(label):hover) {
543
+ --db-check-element-label-color: var(
544
+ --db-adaptive-on-bg-basic-emphasis-100-hovered
545
+ );
546
+ }
547
+ .db-switch:not(:has(input:disabled)):has(input:hover, > label:hover, :is(label):hover):is(label),
548
+ .db-switch:not(:has(input:disabled)):has(input:hover, > label:hover, :is(label):hover) > label {
821
549
  cursor: var(--db-overwrite-cursor, pointer);
822
550
  }
823
- .db-switch:active:not(:disabled, [aria-disabled=true]):is(textarea), .db-switch:active:not(:disabled, [aria-disabled=true]):is(input) {
824
- cursor: initial;
551
+ .db-switch:not(:has(input:disabled)):has(input:hover, > label:hover, :is(label):hover) input {
552
+ cursor: var(--db-overwrite-cursor, pointer);
553
+ background-color: var(--db-adaptive-bg-basic-transparent-hovered);
825
554
  }
826
- .db-switch:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
827
- cursor: pointer;
555
+ .db-switch:not(:has(input:disabled)):has(input:active, > label:active, :is(label):active) {
556
+ --db-check-element-label-color: var(
557
+ --db-adaptive-on-bg-basic-emphasis-100-pressed
558
+ );
559
+ }
560
+ .db-switch:not(:has(input:disabled)):has(input:active, > label:active, :is(label):active):is(label),
561
+ .db-switch:not(:has(input:disabled)):has(input:active, > label:active, :is(label):active) > label {
562
+ cursor: var(--db-overwrite-cursor, pointer);
563
+ }
564
+ .db-switch:not(:has(input:disabled)):has(input:active, > label:active, :is(label):active) input {
565
+ cursor: var(--db-overwrite-cursor, pointer);
566
+ background-color: var(--db-adaptive-bg-basic-transparent-pressed);
828
567
  }
829
568
  .db-switch > input {
830
569
  --db-icon-margin-start: 0;
@@ -837,7 +576,6 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
837
576
  align-items: center;
838
577
  /* stylelint-disable-next-line db-ux/use-spacings */
839
578
  gap: 0.125rem;
840
- background-color: var(--db-adaptive-bg-basic-transparent-full-default);
841
579
  border-radius: var(--db-border-radius-full);
842
580
  /* positioned at the end of the track: track length - 100% (thumb width) */
843
581
  }
@@ -852,6 +590,7 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
852
590
  }
853
591
  }
854
592
  .db-switch > input::after {
593
+ --db-icon-color: var(--db-adaptive-on-bg-basic-emphasis-100-default);
855
594
  visibility: hidden;
856
595
  align-self: center;
857
596
  aspect-ratio: 1;
@@ -862,8 +601,8 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
862
601
  align-content: center;
863
602
  aspect-ratio: 1;
864
603
  block-size: calc(var(--db-icon-font-size) - 0.125rem * 2);
865
- background-color: var(--db-adaptive-bg-inverted-contrast-max-default);
866
- color: var(--db-adaptive-bg-inverted-contrast-max-default);
604
+ background-color: var(--db-adaptive-on-bg-basic-emphasis-100-default);
605
+ color: var(--db-adaptive-on-bg-basic-emphasis-100-default);
867
606
  border-radius: var(--db-border-radius-full);
868
607
  transform: translateX(var(--thumb-offset-x));
869
608
  margin-inline-end: calc(calc(var(--db-icon-font-size)) - calc(var(--db-icon-font-size) - 0.125rem * 2));
@@ -924,6 +663,9 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
924
663
  .db-switch > input:checked:active:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-switch > input:checked:active:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
925
664
  cursor: pointer;
926
665
  }
666
+ .db-switch > input:checked::after {
667
+ --db-icon-color: var(--db-adaptive-on-bg-inverted-default);
668
+ }
927
669
  .db-switch > input:checked::before {
928
670
  block-size: calc(var(--db-icon-font-size));
929
671
  background-color: var(--db-adaptive-on-bg-inverted-default);
@@ -989,6 +731,12 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
989
731
  background-color: var(--db-adaptive-on-bg-inverted-default);
990
732
  color: var(--db-adaptive-on-bg-inverted-default);
991
733
  }
734
+ .db-switch[data-emphasis=strong] > input:checked::after {
735
+ --db-icon-color: var(--db-adaptive-on-bg-inverted-default);
736
+ }
737
+ .db-switch[data-emphasis=strong] > input::after {
738
+ --db-icon-color: var(--db-adaptive-on-bg-inverted-default);
739
+ }
992
740
  .db-switch[data-emphasis=strong] > input::before {
993
741
  background-color: var(--db-adaptive-on-bg-inverted-default);
994
742
  color: var(--db-adaptive-on-bg-inverted-default);
@@ -38,11 +38,12 @@ $checked-active-transition-size: calc(
38
38
  .db-switch {
39
39
  user-select: none;
40
40
 
41
- @include form-components.set-default-check-element(switch);
41
+ @include form-components.set-default-check-element();
42
42
 
43
- // This is needed when clicking on the label instead of the input
44
- @include helpers.active {
45
- > input {
43
+ &:not(:has(input:disabled)) {
44
+ @include form-components.get-state();
45
+
46
+ @include form-components.get-state("active") {
46
47
  @extend %active-transition;
47
48
  }
48
49
  }
@@ -63,12 +64,13 @@ $checked-active-transition-size: calc(
63
64
  align-items: center;
64
65
  /* stylelint-disable-next-line db-ux/use-spacings */
65
66
  gap: $switch-fixed-padding;
66
- background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
67
67
  border-radius: variables.$db-border-radius-full;
68
68
 
69
69
  @include icons.set-icon("cross", "after");
70
70
 
71
71
  &::after {
72
+ --db-icon-color: #{colors.$db-adaptive-on-bg-basic-emphasis-100-default};
73
+
72
74
  visibility: hidden;
73
75
  align-self: center;
74
76
  aspect-ratio: 1;
@@ -81,8 +83,8 @@ $checked-active-transition-size: calc(
81
83
  align-content: center;
82
84
  aspect-ratio: 1;
83
85
  block-size: $switch-inactive-thumb-size;
84
- background-color: colors.$db-adaptive-bg-inverted-contrast-max-default;
85
- color: colors.$db-adaptive-bg-inverted-contrast-max-default;
86
+ background-color: colors.$db-adaptive-on-bg-basic-emphasis-100-default;
87
+ color: colors.$db-adaptive-on-bg-basic-emphasis-100-default;
86
88
  border-radius: variables.$db-border-radius-full;
87
89
  transform: translateX(var(--thumb-offset-x));
88
90
  margin-inline-end: calc(
@@ -123,6 +125,10 @@ $checked-active-transition-size: calc(
123
125
  border-color: colors.$db-adaptive-on-bg-basic-emphasis-100-pressed;
124
126
  }
125
127
 
128
+ &::after {
129
+ --db-icon-color: #{colors.$db-adaptive-on-bg-inverted-default};
130
+ }
131
+
126
132
  &::before {
127
133
  block-size: $switch-active-thumb-size;
128
134
  background-color: colors.$db-adaptive-on-bg-inverted-default;
@@ -197,6 +203,14 @@ $checked-active-transition-size: calc(
197
203
  background-color: colors.$db-adaptive-on-bg-inverted-default;
198
204
  color: colors.$db-adaptive-on-bg-inverted-default;
199
205
  }
206
+
207
+ &::after {
208
+ --db-icon-color: #{colors.$db-adaptive-on-bg-inverted-default};
209
+ }
210
+ }
211
+
212
+ &::after {
213
+ --db-icon-color: #{colors.$db-adaptive-on-bg-inverted-default};
200
214
  }
201
215
 
202
216
  &::before {