Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
ui-components: fix Input styles for Firefox
Browse files Browse the repository at this point in the history
Firefox handled differently <input/> width so spinner
group was moved out of container's borders.
Applying 'overflow': auto attribute fixes this problem

@firefox-only mixin allows to apply styles for Firefox
browser only.
  • Loading branch information
koorosh committed May 22, 2020
1 parent 111aa7a commit 8fb592a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/ui-components/src/Input/number-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// remove default arrow spinner for input -- Firefox browser
.input[type=number] {
-moz-appearance: textfield;
@include firefox-only {
width: -moz-available;
overflow-x: auto
}
}

// Following block describes styles for "Up" and "Down" buttons
Expand All @@ -25,6 +29,7 @@
position: relative;
right: 0;
width: 32px;
min-width: 32px;
}

.spin-button {
Expand Down
10 changes: 10 additions & 0 deletions packages/ui-components/src/styles/tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ $crl-base-divider: $crl-neutral-5;
}
}

@mixin firefox-only {
@at-root {
@-moz-document url-prefix() {
& {
@content;
}
}
}
}

/**
Variables
*/
Expand Down

0 comments on commit 8fb592a

Please sign in to comment.