Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(styles): add missing v10 styles to number input #10706

Merged
merged 4 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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