Skip to content

Commit

Permalink
Merge pull request #2201 from alphagov/file-upload-safari
Browse files Browse the repository at this point in the history
Set `-webkit-appearance: button` on file upload so text is aligned in Safari
  • Loading branch information
Vanita Barrett authored Apr 26, 2021
2 parents 522a489 + 6997d57 commit a42f4ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This was added in [pull request #2164: Enable cookie banner to set link styled a
- [#2171: Fix padding on GOV.UK logo affecting hover and focus states](https://github.com/alphagov/govuk-frontend/pull/2171)
- [#2186: Fix display of warning text in Edge when Windows High Contrast Mode is enabled](https://github.com/alphagov/govuk-frontend/pull/2186)
- [#2192: Add data-nosnippet to prevent cookie banner text appearing in Google Search snippets](https://github.com/alphagov/govuk-frontend/pull/2192)
- [#2201: Set -webkit-appearance: button on file upload so text is aligned in Safari](https://github.com/alphagov/govuk-frontend/pull/2201)

## 3.11.0 (Feature release)

Expand Down
11 changes: 11 additions & 0 deletions src/govuk/components/file-upload/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
padding-top: $component-padding;
padding-bottom: $component-padding;

// The default file upload button in Safari does not
// support setting a custom font-size. Set `-webkit-appearance`
// to `button` to drop out of the native appearance so the
// font-size is set to 19px
// https://bugs.webkit.org/show_bug.cgi?id=224746
&::-webkit-file-upload-button {
-webkit-appearance: button;
color: inherit;
font: inherit;
}

&:focus {
// "Yank" the padding with negative margin to avoid a jump
// when element is focused
Expand Down

0 comments on commit a42f4ae

Please sign in to comment.