Skip to content

Commit

Permalink
fix(styles): add missing v10 styles to number input (#10706)
Browse files Browse the repository at this point in the history
* fix: v11 audit styles

* fix: v10 type style

* fix: firefox z-index
  • Loading branch information
jnm2377 authored Feb 14, 2022
1 parent 6a49764 commit 706020c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

.#{$prefix}--number input[type='number'] {
@include type-style('body-short-01');
@include type-style('code-01');
@include focus-outline('reset');

display: inline-flex;
Expand Down
47 changes: 29 additions & 18 deletions packages/styles/scss/components/number-input/_number-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@use '../../utilities/high-contrast-mode' as *;
@use '../../utilities/focus-outline' as *;
@use '../../utilities/convert' as *;
@use '../../utilities/z-index' as *;

/// Number input styles
/// @access public
Expand All @@ -31,7 +32,7 @@
}

.#{$prefix}--number input[type='number'] {
@include type-style('body-short-01');
@include type-style('code-01');
@include focus-outline('reset');

display: inline-flex;
Expand Down Expand Up @@ -88,8 +89,7 @@
padding-right: rem(112px);
}

.#{$prefix}--number input[type='number']:disabled,
.#{$prefix}--number--readonly input[type='number'] {
.#{$prefix}--number input[type='number']:disabled {
border-bottom-color: transparent;
background-color: $field;
color: $text-disabled;
Expand Down Expand Up @@ -301,10 +301,6 @@
background-color: transparent;
}

.#{$prefix}--number--readonly .#{$prefix}--number__control-btn {
display: none;
}

.#{$prefix}--number__invalid {
position: absolute;
right: rem(96px);
Expand Down Expand Up @@ -368,10 +364,7 @@
}

// V11: Possibly deprecate
.#{$prefix}--number--light input[type='number']:disabled,
.#{$prefix}--number--light
.#{$prefix}--number--readonly
input[type='number'] {
.#{$prefix}--number--light input[type='number']:disabled {
background-color: $field-02;
}

Expand All @@ -381,18 +374,22 @@
background-color: $field-02;
}

// V11: Possibly deprecate
.#{$prefix}--number--light .#{$prefix}--number__control-btn:hover,
.#{$prefix}--number--light .#{$prefix}--number__control-btn:hover::before,
.#{$prefix}--number--light .#{$prefix}--number__control-btn:hover::after {
background-color: $layer-hover-02;
}

.#{$prefix}--number--light .#{$prefix}--number__control-btn:focus::before,
.#{$prefix}--number--light .#{$prefix}--number__control-btn:focus::after {
background-color: transparent;
}

// V11: Possibly deprecate
// We include `:not(:focus)` here because the pseudo elements will overlap the
// focus outline on the button if we set their background-color on focus
.#{$prefix}--number--light .#{$prefix}--number__control-btn:hover,
.#{$prefix}--number--light
.#{$prefix}--number__control-btn:not(:focus):hover::before,
.#{$prefix}--number--light
.#{$prefix}--number__control-btn:not(:focus):hover::after {
background-color: $layer-hover-02;
}

// Size Variant styles
// TODO V11: Remove xl selector
.#{$prefix}--number--xl input[type='number'],
Expand Down Expand Up @@ -452,6 +449,20 @@
right: rem(16px);
}

// Readonly
.#{$prefix}--number--readonly input[type='number'] {
background: transparent;
}

.#{$prefix}--number--readonly .#{$prefix}--number__controls {
display: none;
}

.#{$prefix}--number__readonly-icon {
position: absolute;
right: rem(16px);
}

// Skeleton State
.#{$prefix}--number.#{$prefix}--skeleton {
@include skeleton;
Expand Down

0 comments on commit 706020c

Please sign in to comment.