@decidables/decidables-elements 0.5.7 → 0.6.0

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.
@@ -1561,10 +1561,6 @@ Selection$1.prototype = selection.prototype = {
1561
1561
  [Symbol.iterator]: selection_iterator
1562
1562
  };
1563
1563
 
1564
- function select (selector) {
1565
- return typeof selector === "string" ? new Selection$1([[document.querySelector(selector)]], [document.documentElement]) : new Selection$1([[selector]], root);
1566
- }
1567
-
1568
1564
  function define (constructor, factory, prototype) {
1569
1565
  constructor.prototype = factory.prototype = prototype;
1570
1566
  prototype.constructor = constructor;
@@ -3086,18 +3082,6 @@ class DecidablesElement extends i {
3086
3082
  getComputedStyleValue(property) {
3087
3083
  return getComputedStyle(this).getPropertyValue(property).trim();
3088
3084
  }
3089
- firstUpdated(changedProperties) {
3090
- super.firstUpdated(changedProperties);
3091
-
3092
- // Use focus highlighting if keyboard is used at all
3093
- select(this.renderRoot.host).classed('keyboard', true).on('mousemove.keyboard touchstart.keyboard', event => {
3094
- const element = event.currentTarget;
3095
- select(element.renderRoot.host).classed('keyboard', false).on('mousemove.keyboard touchstart.keyboard', null);
3096
- }).on('keydown.keyboard', event => {
3097
- const element = event.currentTarget;
3098
- select(element.renderRoot.host).classed('keyboard', true).on('keydown.keyboard mousemove.keyboard touchstart.keyboard', null);
3099
- });
3100
- }
3101
3085
  static get greys() {
3102
3086
  const grey = '#999999';
3103
3087
  const greys = {};
@@ -3233,7 +3217,7 @@ class DecidablesElement extends i {
3233
3217
  };
3234
3218
  /* eslint-enable key-spacing, object-curly-newline */
3235
3219
  }
3236
- static cssBoxShadow(elevation, rotate = false, inverse = false) {
3220
+ static cssBoxShadow(elevation, inverse = false) {
3237
3221
  const umbraO = this.shadows.opacityUmbra + this.shadows.opacityBoost;
3238
3222
  const penumbraO = this.shadows.opacityPenumbra + this.shadows.opacityBoost;
3239
3223
  const ambientO = this.shadows.opacityAmbient + this.shadows.opacityBoost;
@@ -3243,9 +3227,9 @@ class DecidablesElement extends i {
3243
3227
  const umbraM = this.shadows.mapUmbra[elevation];
3244
3228
  const penumbraM = this.shadows.mapPenumbra[elevation];
3245
3229
  const ambientM = this.shadows.mapAmbient[elevation];
3246
- const umbraS = rotate ? `${-umbraM.y}px ${umbraM.y / 2}px ${umbraM.b}px ${umbraM.s}px` : `${umbraM.y / 2}px ${umbraM.y}px ${umbraM.b}px ${umbraM.s}px`;
3247
- const penumbraS = rotate ? `${-penumbraM.y}px ${penumbraM.y / 2}px ${penumbraM.b}px ${penumbraM.s}px` : `${penumbraM.y / 2}px ${penumbraM.y}px ${penumbraM.b}px ${penumbraM.s}px`;
3248
- const ambientS = rotate ? `${-ambientM.y}px ${ambientM.y / 2}px ${ambientM.b}px ${ambientM.s}px` : `${ambientM.y / 2}px ${ambientM.y}px ${ambientM.b}px ${ambientM.s}px`;
3230
+ const umbraS = `${umbraM.y / 2}px ${umbraM.y}px ${umbraM.b}px ${umbraM.s}px`;
3231
+ const penumbraS = `${penumbraM.y / 2}px ${penumbraM.y}px ${penumbraM.b}px ${penumbraM.s}px`;
3232
+ const ambientS = `${ambientM.y / 2}px ${ambientM.y}px ${ambientM.b}px ${ambientM.s}px`;
3249
3233
  return `${umbraS} ${umbraC}, ${penumbraS} ${penumbraC}, ${ambientS} ${ambientC}`;
3250
3234
  }
3251
3235
  static get svgFilters() {
@@ -3381,49 +3365,58 @@ class DecidablesButton extends DecidablesElement {
3381
3365
  button {
3382
3366
  width: 100%;
3383
3367
  height: 100%;
3368
+
3384
3369
  padding: 0.375rem 0.75rem;
3385
3370
 
3386
3371
  font-family: var(---font-family-base);
3387
3372
  font-size: 1.125rem;
3373
+
3388
3374
  line-height: 1.5;
3375
+
3389
3376
  color: var(---color-text-inverse);
3390
3377
 
3378
+ outline: none;
3379
+
3391
3380
  border: 0;
3392
3381
  border-radius: var(---border-radius);
3393
- outline: none;
3394
3382
  }
3395
3383
 
3396
3384
  button:disabled {
3397
- background-color: var(---decidables-button-background-color-disabled);
3398
3385
  outline: none;
3386
+
3387
+ background-color: var(---decidables-button-background-color-disabled);
3399
3388
  box-shadow: none;
3400
3389
  }
3401
3390
 
3402
3391
  button:enabled {
3403
3392
  cursor: pointer;
3393
+ outline: none;
3404
3394
 
3405
3395
  background-color: var(---decidables-button-background-color-enabled);
3406
- outline: none;
3407
3396
  box-shadow: var(---shadow-2);
3408
3397
  }
3409
3398
 
3410
3399
  button:enabled:hover {
3411
3400
  outline: none;
3401
+
3412
3402
  box-shadow: var(---shadow-4);
3413
3403
  }
3414
3404
 
3415
3405
  button:enabled:active {
3416
3406
  outline: none;
3407
+
3417
3408
  box-shadow: var(---shadow-8);
3418
3409
  }
3419
3410
 
3420
- :host(.keyboard) button:enabled:focus {
3411
+ button:enabled:focus-visible {
3421
3412
  outline: none;
3413
+
3422
3414
  box-shadow: var(---shadow-4);
3423
3415
  }
3424
3416
 
3425
- :host(.keyboard) button:enabled:focus:active {
3417
+ button:enabled:focus-visible:active {
3426
3418
  outline: none;
3419
+
3427
3420
  box-shadow: var(---shadow-8);
3428
3421
  }
3429
3422
  `];
@@ -3540,10 +3533,6 @@ class DecidablesSlider extends DecidablesElement {
3540
3533
  ---decidables-slider-color: var(--decidables-slider-color, var(---color-element-enabled));
3541
3534
  ---decidables-spinner-background-color: var(--decidables-slider-background-color, none);
3542
3535
 
3543
- ---shadow-2-rotate: var(--shadow-2-rotate, ${r$2(this.cssBoxShadow(2, true, false))});
3544
- ---shadow-4-rotate: var(--shadow-4-rotate, ${r$2(this.cssBoxShadow(4, true, false))});
3545
- ---shadow-8-rotate: var(--shadow-8-rotate, ${r$2(this.cssBoxShadow(8, true, false))});
3546
-
3547
3536
  display: flex;
3548
3537
 
3549
3538
  flex-direction: column;
@@ -3558,12 +3547,14 @@ class DecidablesSlider extends DecidablesElement {
3558
3547
 
3559
3548
  .range {
3560
3549
  position: relative;
3550
+
3561
3551
  display: flex;
3562
3552
 
3563
3553
  flex-direction: row;
3564
3554
 
3565
3555
  width: 3.5rem;
3566
3556
  height: 4.75rem;
3557
+
3567
3558
  margin: 0 0.25rem 0.25rem;
3568
3559
  }
3569
3560
 
@@ -3575,21 +3566,20 @@ class DecidablesSlider extends DecidablesElement {
3575
3566
  background: var(---decidables-spinner-background-color);
3576
3567
  }
3577
3568
 
3578
- /* Adapted from http://danielstern.ca/range.css/#/ */
3579
3569
  /* Overall */
3580
3570
  input[type=range] {
3581
- width: 4.75rem;
3582
- height: 3.5rem;
3571
+ width: 3.5rem;
3572
+ height: 4.75rem;
3573
+
3583
3574
  padding: 0;
3584
3575
  margin: 0;
3576
+
3577
+ appearance: none;
3585
3578
 
3586
3579
  background-color: unset;
3587
3580
 
3588
- transform: rotate(-90deg);
3589
- transform-origin: 2.375rem 2.375rem;
3590
-
3591
- /* stylelint-disable-next-line property-no-vendor-prefix */
3592
- -webkit-appearance: none;
3581
+ direction: rtl;
3582
+ writing-mode: vertical-lr;
3593
3583
  }
3594
3584
 
3595
3585
  input[type=range]:enabled {
@@ -3600,16 +3590,10 @@ class DecidablesSlider extends DecidablesElement {
3600
3590
  outline: none;
3601
3591
  }
3602
3592
 
3603
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3604
- input[type=range]::-ms-tooltip {
3605
- display: none;
3606
- }
3607
-
3608
3593
  /* Track */
3609
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3610
3594
  input[type=range]::-webkit-slider-runnable-track {
3611
- width: 100%;
3612
- height: 4px;
3595
+ width: 4px;
3596
+ height: 100%;
3613
3597
 
3614
3598
  background: var(---decidables-slider-background-color);
3615
3599
  border: 0;
@@ -3621,10 +3605,9 @@ class DecidablesSlider extends DecidablesElement {
3621
3605
  background: var(---decidables-slider-background-color);
3622
3606
  }
3623
3607
 
3624
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3625
3608
  input[type=range]::-moz-range-track {
3626
- width: 100%;
3627
- height: 4px;
3609
+ width: 4px;
3610
+ height: 100%;
3628
3611
 
3629
3612
  background: var(---decidables-slider-background-color);
3630
3613
  border: 0;
@@ -3632,57 +3615,17 @@ class DecidablesSlider extends DecidablesElement {
3632
3615
  box-shadow: none;
3633
3616
  }
3634
3617
 
3635
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3636
- input[type=range]::-ms-track {
3637
- width: 100%;
3638
- height: 4px;
3639
-
3640
- color: transparent;
3641
-
3642
- background: transparent;
3643
- border-color: transparent;
3644
- }
3645
-
3646
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3647
- input[type=range]::-ms-fill-lower {
3648
- background: #cccccc;
3649
- /* background: var(---decidables-slider-background-color); */
3650
- border: 0;
3651
- border-radius: 2px;
3652
- box-shadow: none;
3653
- }
3654
-
3655
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3656
- input[type=range]::-ms-fill-upper {
3657
- background: #cccccc;
3658
- /* background: var(---decidables-slider-background-color); */
3659
- border: 0;
3660
- border-radius: 2px;
3661
- box-shadow: none;
3662
- }
3663
-
3664
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3665
- input[type=range]:focus::-ms-fill-lower {
3666
- background: var(---decidables-slider-background-color);
3667
- }
3668
-
3669
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3670
- input[type=range]:focus::-ms-fill-upper {
3671
- background: var(---decidables-slider-background-color);
3672
- }
3673
-
3674
3618
  /* Thumb */
3675
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3676
3619
  input[type=range]::-webkit-slider-thumb {
3677
- width: 10px;
3678
- height: 20px;
3679
- margin-top: -8px;
3620
+ width: 20px;
3621
+ height: 10px;
3622
+
3623
+ margin-left: -8px;
3624
+
3625
+ appearance: none;
3680
3626
 
3681
3627
  border: 0;
3682
3628
  border-radius: 4px;
3683
-
3684
- /* stylelint-disable-next-line property-no-vendor-prefix */
3685
- -webkit-appearance: none;
3686
3629
  }
3687
3630
 
3688
3631
  input[type=range]:disabled::-webkit-slider-thumb {
@@ -3692,112 +3635,65 @@ class DecidablesSlider extends DecidablesElement {
3692
3635
 
3693
3636
  input[type=range]:enabled::-webkit-slider-thumb {
3694
3637
  background: var(---decidables-slider-color);
3695
- box-shadow: var(---shadow-2-rotate);
3638
+ box-shadow: var(---shadow-2);
3696
3639
  }
3697
3640
 
3698
3641
  input[type=range]:enabled:hover::-webkit-slider-thumb {
3699
- box-shadow: var(---shadow-4-rotate);
3642
+ box-shadow: var(---shadow-4);
3700
3643
  }
3701
3644
 
3702
3645
  input[type=range]:enabled:active::-webkit-slider-thumb {
3703
- box-shadow: var(---shadow-8-rotate);
3646
+ box-shadow: var(---shadow-8);
3704
3647
  }
3705
3648
 
3706
- :host(.keyboard) input[type=range]:enabled:focus::-webkit-slider-thumb {
3707
- box-shadow: var(---shadow-4-rotate);
3649
+ input[type=range]:enabled:focus-visible::-webkit-slider-thumb {
3650
+ box-shadow: var(---shadow-4);
3708
3651
  }
3709
3652
 
3710
- :host(.keyboard) input[type=range]:focus:active::-webkit-slider-thumb {
3711
- box-shadow: var(---shadow-8-rotate);
3653
+ input[type=range]:enabled:focus-visible:active::-webkit-slider-thumb {
3654
+ box-shadow: var(---shadow-8);
3712
3655
  }
3713
3656
 
3714
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3715
3657
  input[type=range]::-moz-range-thumb {
3716
- width: 10px;
3717
- height: 20px;
3658
+ width: 20px;
3659
+ height: 10px;
3718
3660
 
3719
3661
  border: 0;
3720
3662
  border-radius: 4px;
3721
3663
  }
3722
3664
 
3723
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3724
3665
  input[type=range]:disabled::-moz-range-thumb {
3725
3666
  background: var(---decidables-slider-background-color);
3726
3667
  box-shadow: none;
3727
3668
  }
3728
3669
 
3729
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3730
3670
  input[type=range]:enabled::-moz-range-thumb {
3731
3671
  background: var(---decidables-slider-color);
3732
- box-shadow: var(---shadow-2-rotate);
3672
+ box-shadow: var(---shadow-2);
3733
3673
  }
3734
3674
 
3735
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3736
3675
  input[type=range]:enabled:hover::-moz-range-thumb {
3737
- box-shadow: var(---shadow-4-rotate);
3676
+ box-shadow: var(---shadow-4);
3738
3677
  }
3739
3678
 
3740
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3741
3679
  input[type=range]:enabled:active::-moz-range-thumb {
3742
- box-shadow: var(---shadow-8-rotate);
3743
- }
3744
-
3745
- :host(.keyboard) input[type=range]:enabled:focus::-moz-range-thumb {
3746
- box-shadow: var(---shadow-4-rotate);
3747
- }
3748
-
3749
- :host(.keyboard) input[type=range]:enabled:focus:active::-moz-range-thumb {
3750
- box-shadow: var(---shadow-8-rotate);
3751
- }
3752
-
3753
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3754
- input[type=range]::-ms-thumb {
3755
- width: 10px;
3756
- height: 20px;
3757
- margin-top: 0;
3758
-
3759
- background: #999999;
3760
- /* background: var(---color-element-enabled); */
3761
- border: 0;
3762
- border-radius: 4px;
3763
- box-shadow: var(---shadow-2-rotate);
3764
- }
3765
-
3766
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3767
- input[type=range]:disabled::-ms-thumb {
3768
- background: var(---decidables-slider-background-color);
3769
- box-shadow: none;
3770
- }
3771
-
3772
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3773
- input[type=range]:enabled::-ms-thumb {
3774
- background: var(---decidables-slider-color);
3775
- box-shadow: var(---shadow-2-rotate);
3776
- }
3777
-
3778
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3779
- input[type=range]:enabled:hover::-ms-thumb {
3780
- box-shadow: var(---shadow-4-rotate);
3781
- }
3782
-
3783
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3784
- input[type=range]:enabled:active::-ms-thumb {
3785
- box-shadow: var(---shadow-8-rotate);
3680
+ box-shadow: var(---shadow-8);
3786
3681
  }
3787
3682
 
3788
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
3789
- :host(.keyboard) input[type=range]:enabled:focus::-ms-thumb {
3790
- box-shadow: var(---shadow-4-rotate);
3683
+ input[type=range]:enabled:focus-visible::-moz-range-thumb {
3684
+ box-shadow: var(---shadow-4);
3791
3685
  }
3792
3686
 
3793
- :host(.keyboard) input[type=range]:enabled:focus:active::-ms-thumb {
3794
- box-shadow: var(---shadow-8-rotate);
3687
+ input[type=range]:enabled:focus-visible:active::-moz-range-thumb {
3688
+ box-shadow: var(---shadow-8);
3795
3689
  }
3796
3690
 
3797
- datalist {
3691
+ /* Tick marks */
3692
+ .datalist {
3798
3693
  position: absolute;
3799
3694
  left: 2rem;
3800
3695
  z-index: -1;
3696
+
3801
3697
  display: flex;
3802
3698
 
3803
3699
  flex-direction: column;
@@ -3810,14 +3706,13 @@ class DecidablesSlider extends DecidablesElement {
3810
3706
  font-size: 0.75rem;
3811
3707
  }
3812
3708
 
3813
- option {
3814
- padding: 0;
3815
-
3709
+ .option {
3816
3710
  line-height: 0.8;
3817
- min-block-size: 0;
3711
+
3712
+ white-space: nowrap;
3818
3713
  }
3819
3714
 
3820
- option::before {
3715
+ .option::before {
3821
3716
  content: "– ";
3822
3717
  }
3823
3718
  `];
@@ -3830,10 +3725,10 @@ class DecidablesSlider extends DecidablesElement {
3830
3725
  <div class="range">
3831
3726
  <input ?disabled=${this.disabled} type="range" id="slider" min=${o(this.rangeMin)} max=${o(this.rangeMax)} step=${o(this.rangeStep)} .value=${this.rangeValue} @change=${this.rangeChanged.bind(this)} @input=${this.rangeInputted.bind(this)}>
3832
3727
  ${this.scale ? x`
3833
- <datalist id="ticks">
3834
- <option value=${o(this.rangeMax)} label=${o(this.max)}></option>
3835
- <option value=${o(this.rangeMin)} label=${o(this.min)}></option>
3836
- </datalist>
3728
+ <div class="datalist">
3729
+ <div class="option">${o(this.max)}</div>
3730
+ <div class="option">${o(this.min)}</div>
3731
+ </div>
3837
3732
  ` : x``}
3838
3733
  </div>
3839
3734
  <decidables-spinner ?disabled=${this.disabled} min=${o(this.min)} max=${o(this.max)} step=${o(this.step)} .value=${this.value} @input=${this.spinnerInputted.bind(this)}></decidables-spinner>
@@ -3893,13 +3788,14 @@ class DecidablesSpinner extends DecidablesElement {
3893
3788
  ---decidables-spinner-prefix: var(--decidables-spinner-prefix, "");
3894
3789
 
3895
3790
  ---decidables-spinner-postfix: var(--decidables-spinner-postfix, "");
3896
- ---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding, 0);
3791
+ ---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding, 0rem);
3897
3792
 
3898
3793
  display: block;
3899
3794
  }
3900
3795
 
3901
3796
  label {
3902
3797
  position: relative;
3798
+
3903
3799
  display: flex;
3904
3800
 
3905
3801
  flex-direction: column;
@@ -3917,6 +3813,7 @@ class DecidablesSpinner extends DecidablesElement {
3917
3813
  left: calc(50% - var(---decidables-spinner-input-width) / 2 + 0.25rem);
3918
3814
 
3919
3815
  font-size: var(---decidables-spinner-font-size);
3816
+
3920
3817
  line-height: normal;
3921
3818
 
3922
3819
  content: var(---decidables-spinner-prefix);
@@ -3928,6 +3825,7 @@ class DecidablesSpinner extends DecidablesElement {
3928
3825
  bottom: 1px;
3929
3826
 
3930
3827
  font-size: var(---decidables-spinner-font-size);
3828
+
3931
3829
  line-height: normal;
3932
3830
 
3933
3831
  content: var(---decidables-spinner-postfix);
@@ -3935,20 +3833,24 @@ class DecidablesSpinner extends DecidablesElement {
3935
3833
 
3936
3834
  input[type=number] {
3937
3835
  width: var(---decidables-spinner-input-width);
3938
- padding-right: var(---decidables-spinner-postfix-padding);
3836
+
3837
+ padding: 1px var(---decidables-spinner-postfix-padding) 1px 2px;
3838
+ margin: 0;
3939
3839
 
3940
3840
  font-family: var(---font-family-base);
3941
3841
  font-size: var(---decidables-spinner-font-size);
3842
+
3942
3843
  color: inherit;
3844
+
3943
3845
  text-align: right;
3944
3846
 
3847
+ appearance: none;
3848
+ outline: none;
3849
+
3945
3850
  background: none;
3946
3851
  border: 0;
3947
3852
  border-radius: 0;
3948
- outline: none;
3949
3853
  box-shadow: var(---shadow-2);
3950
-
3951
- -webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
3952
3854
  }
3953
3855
 
3954
3856
  input[type=number]:hover {
@@ -3965,20 +3867,54 @@ class DecidablesSpinner extends DecidablesElement {
3965
3867
 
3966
3868
  border: 0;
3967
3869
  box-shadow: none;
3870
+ }
3871
+
3872
+ /* HACK: Manage spinners in Firefox */
3873
+ @supports (-moz-appearance: textfield) {
3874
+ input[type=number] {
3875
+ padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
3876
+
3877
+ appearance: textfield;
3878
+ }
3879
+
3880
+ input[type=number]:hover,
3881
+ input[type=number]:focus,
3882
+ input[type=number]:active {
3883
+ padding-right: var(---decidables-spinner-postfix-padding);
3884
+
3885
+ appearance: none;
3886
+ }
3887
+
3888
+ input[type=number]:disabled {
3889
+ padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
3890
+
3891
+ appearance: textfield;
3892
+ }
3893
+ }
3894
+
3895
+ /* HACK: Manage spinners in Chrome/Edge/Safari */
3896
+ input[type=number]::-webkit-inner-spin-button {
3897
+ /* Avoid oversized spinners in Safari */
3898
+ font-size: 1.125rem;
3899
+
3900
+ opacity: 0;
3901
+ }
3968
3902
 
3969
- /* HACK: Use correct text color in Safari */
3970
- -webkit-opacity: 1;
3971
- /* HACK: Hide spinners in disabled input for Firefox and Safari */
3972
- -moz-appearance: textfield; /* stylelint-disable-line property-no-vendor-prefix */
3973
- /* HACK: Use correct text color in Safari */
3974
- -webkit-text-fill-color: var(---color-text);
3903
+ input[type=number]:hover::-webkit-inner-spin-button,
3904
+ input[type=number]:focus::-webkit-inner-spin-button,
3905
+ input[type=number]:active::-webkit-inner-spin-button {
3906
+ opacity: 1;
3975
3907
  }
3976
3908
 
3977
- /* HACK: Hide spinners in disabled input for Firefox and Safari */
3978
- input[type=number]:disabled::-webkit-outer-spin-button,
3979
3909
  input[type=number]:disabled::-webkit-inner-spin-button {
3980
- margin: 0;
3981
- -webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
3910
+ opacity: 0;
3911
+ }
3912
+
3913
+ /* HACK: Adjust padding on mobile w/o spinners */
3914
+ @media only screen and (hover: none) and (pointer: coarse) {
3915
+ input[type=number] {
3916
+ padding-right: calc(1.125rem + var(---decidables-spinner-postfix-padding));
3917
+ }
3982
3918
  }
3983
3919
  `];
3984
3920
  }
@@ -4042,13 +3978,16 @@ class DecidablesSwitch extends DecidablesElement {
4042
3978
 
4043
3979
  width: 1px;
4044
3980
  height: 1px;
3981
+
4045
3982
  padding: 0;
4046
3983
  margin: -1px;
3984
+
4047
3985
  overflow: hidden;
4048
3986
 
4049
3987
  white-space: nowrap;
4050
3988
 
4051
3989
  border: 0;
3990
+
4052
3991
  clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
4053
3992
  }
4054
3993
 
@@ -4064,6 +4003,7 @@ class DecidablesSwitch extends DecidablesElement {
4064
4003
  position: relative;
4065
4004
 
4066
4005
  min-width: 24px;
4006
+
4067
4007
  padding: 0 0 36px;
4068
4008
  margin: 0.25rem 0.25rem 0;
4069
4009
 
@@ -4075,17 +4015,17 @@ class DecidablesSwitch extends DecidablesElement {
4075
4015
  input[type=checkbox] + label + label::before,
4076
4016
  input[type=checkbox] + label + label::after {
4077
4017
  position: absolute;
4078
-
4079
4018
  left: 50%;
4080
4019
 
4081
4020
  margin: 0;
4082
4021
 
4083
- content: "";
4084
-
4085
4022
  outline: 0;
4086
4023
 
4087
- transition: all var(---transition-duration) ease;
4024
+ content: "";
4025
+
4088
4026
  transform: translate(-50%, 0);
4027
+
4028
+ transition: all var(---transition-duration) ease;
4089
4029
  }
4090
4030
 
4091
4031
  input[type=checkbox] + label + label::before {
@@ -4133,17 +4073,14 @@ class DecidablesSwitch extends DecidablesElement {
4133
4073
  box-shadow: var(---shadow-8);
4134
4074
  }
4135
4075
 
4136
- /* stylelint-disable-next-line selector-max-compound-selectors */
4137
- :host(.keyboard) input[type=checkbox]:enabled:focus + label + label::after {
4076
+ input[type=checkbox]:enabled:focus-visible + label + label::after {
4138
4077
  box-shadow: var(---shadow-4);
4139
4078
  }
4140
4079
 
4141
- /* stylelint-disable selector-max-compound-selectors */
4142
- :host(.keyboard) input[type=checkbox]:enabled:focus + label + label:active::after,
4143
- :host(.keyboard) input[type=checkbox]:enabled:focus:active + label + label::after {
4080
+ input[type=checkbox]:enabled:focus-visible + label + label:active::after,
4081
+ input[type=checkbox]:enabled:focus-visible:active + label + label::after {
4144
4082
  box-shadow: var(---shadow-8);
4145
4083
  }
4146
- /* stylelint-enable selector-max-compound-selectors */
4147
4084
  `];
4148
4085
  }
4149
4086
  render() {
@@ -4263,39 +4200,46 @@ class DecidablesToggleOption extends DecidablesElement {
4263
4200
 
4264
4201
  width: 1px;
4265
4202
  height: 1px;
4203
+
4266
4204
  padding: 0;
4267
4205
  margin: -1px;
4206
+
4268
4207
  overflow: hidden;
4269
4208
 
4270
4209
  white-space: nowrap;
4271
4210
 
4272
4211
  border: 0;
4212
+
4273
4213
  clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
4274
4214
  }
4275
4215
 
4276
4216
  input[type=radio] + label {
4277
4217
  width: 100%;
4218
+
4278
4219
  padding: 0.375rem 0.75rem;
4279
4220
 
4280
4221
  font-family: var(---font-family-base);
4281
4222
  font-size: 1.125rem;
4223
+
4282
4224
  line-height: 1.5;
4225
+
4283
4226
  color: var(---color-text-inverse);
4227
+
4284
4228
  text-align: center;
4285
4229
 
4286
4230
  cursor: pointer;
4231
+ outline: none;
4287
4232
 
4288
4233
  background-color: var(---color-element-enabled);
4289
4234
  border: 0;
4290
4235
  border-radius: 0;
4291
- outline: none;
4292
-
4293
4236
  box-shadow: var(---shadow-2);
4294
4237
  }
4295
4238
 
4296
4239
  input[type=radio]:checked + label {
4297
- background-color: var(---color-element-selected);
4298
4240
  outline: none;
4241
+
4242
+ background-color: var(---color-element-selected);
4299
4243
  box-shadow: var(---shadow-2);
4300
4244
  }
4301
4245
 
@@ -4303,6 +4247,7 @@ class DecidablesToggleOption extends DecidablesElement {
4303
4247
  z-index: 1;
4304
4248
 
4305
4249
  outline: none;
4250
+
4306
4251
  box-shadow: var(---shadow-4);
4307
4252
  }
4308
4253
 
@@ -4310,6 +4255,7 @@ class DecidablesToggleOption extends DecidablesElement {
4310
4255
  z-index: 2;
4311
4256
 
4312
4257
  outline: none;
4258
+
4313
4259
  box-shadow: var(---shadow-8);
4314
4260
  }
4315
4261
 
@@ -4323,25 +4269,28 @@ class DecidablesToggleOption extends DecidablesElement {
4323
4269
  border-bottom-left-radius: 0.25rem;
4324
4270
  }
4325
4271
 
4326
- :host(.keyboard) input[type=radio]:focus + label {
4272
+ input[type=radio]:focus-visible + label {
4327
4273
  z-index: 1;
4328
4274
 
4329
4275
  outline: none;
4276
+
4330
4277
  box-shadow: var(---shadow-4);
4331
4278
  }
4332
4279
 
4333
- :host(.keyboard) input[type=radio]:focus:checked + label {
4280
+ input[type=radio]:focus-visible:checked + label {
4334
4281
  z-index: 1;
4335
4282
 
4336
- background-color: var(---color-element-selected);
4337
4283
  outline: none;
4284
+
4285
+ background-color: var(---color-element-selected);
4338
4286
  box-shadow: var(---shadow-4);
4339
4287
  }
4340
4288
 
4341
- :host(.keyboard) input[type=radio]:focus + label:active {
4289
+ input[type=radio]:focus-visible + label:active {
4342
4290
  z-index: 2;
4343
4291
 
4344
4292
  outline: none;
4293
+
4345
4294
  box-shadow: var(---shadow-8);
4346
4295
  }
4347
4296
  `];