-
Notifications
You must be signed in to change notification settings - Fork 340
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 disabled File upload hover state #5757
Merged
romaricpascal
merged 1 commit into
spike-enhanced-file-upload
from
fix-disabled-hover-on-label
Feb 27, 2025
Merged
Fix disabled File upload hover state #5757
romaricpascal
merged 1 commit into
spike-enhanced-file-upload
from
fix-disabled-hover-on-label
Feb 27, 2025
+21
−8
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Avoid visual changes when hovering the `<label>`, which triggers the associated field's `:hover` state. Moves the button's disabled state to the end of the component CSS so it can override any of the other states, and uses variables to reset the colour to the empty state colours (as a file input cannot be pre-filled).
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for 2795465 |
Stylesheets changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
index 5bef099c0..52af7c35a 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
@@ -3480,11 +3480,6 @@ screen and (forced-colors:active) {
box-shadow: inset 0 0 0 1px #fd0
}
-.govuk-file-upload-button:disabled {
- pointer-events: none;
- opacity: .5
-}
-
.govuk-file-upload-button--empty {
border-style: dashed;
background-color: #fff
@@ -3533,6 +3528,20 @@ screen and (forced-colors:active) {
background-color: #dbdad9
}
+.govuk-file-upload-button:disabled {
+ pointer-events: none;
+ opacity: .5;
+ background-color: #fff
+}
+
+.govuk-file-upload-button:disabled .govuk-file-upload-button__pseudo-button {
+ background-color: #f3f2f1
+}
+
+.govuk-file-upload-button:disabled .govuk-file-upload-button__status {
+ background-color: #bbd4ea
+}
+
.govuk-footer {
font-family: GDS Transport, arial, sans-serif;
-webkit-font-smoothing: antialiased;
Action run for 2795465 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss b/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss
index 08c9705e5..c88c66c77 100644
--- a/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss
+++ b/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss
@@ -5,6 +5,9 @@
@include govuk-exports("govuk/component/file-upload") {
$file-upload-border-width: 2px;
$component-padding: govuk-spacing(1);
+ $empty-button-background-colour: govuk-colour("white");
+ $empty-pseudo-button-background-colour: govuk-colour("light-grey");
+ $empty-status-background-colour: govuk-tint(govuk-colour("blue"), 70%);
.govuk-file-upload {
@include govuk-font($size: 19);
@@ -146,24 +149,19 @@
box-shadow: inset 0 0 0 1px $govuk-focus-colour;
}
}
-
- &:disabled {
- pointer-events: none;
- opacity: 0.5;
- }
}
.govuk-file-upload-button--empty {
border-style: dashed;
- background-color: govuk-colour("white");
+ background-color: $empty-button-background-colour;
.govuk-file-upload-button__pseudo-button {
- background-color: govuk-colour("light-grey");
+ background-color: $empty-pseudo-button-background-colour;
}
.govuk-file-upload-button__status {
color: govuk-shade(govuk-colour("blue"), 60%);
- background-color: govuk-tint(govuk-colour("blue"), 70%);
+ background-color: $empty-status-background-colour;
}
&:hover,
@@ -200,6 +198,21 @@
background-color: govuk-shade(govuk-colour("light-grey"), 10%);
}
}
+
+ .govuk-file-upload-button:disabled {
+ pointer-events: none;
+ opacity: 0.5;
+
+ background-color: $empty-button-background-colour;
+
+ .govuk-file-upload-button__pseudo-button {
+ background-color: $empty-pseudo-button-background-colour;
+ }
+
+ .govuk-file-upload-button__status {
+ background-color: $empty-status-background-colour;
+ }
+ }
}
/*# sourceMappingURL=_index.scss.map */
Action run for 2795465 |
patrickpatrickpatrick
approved these changes
Feb 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That fixes the issue, looks good
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoid visual changes when hovering the
<label>
, which triggers the associated field's:hover
state.Moves the button's disabled state to the end of the component CSS so it can override any of the other states, and uses variables to reset the colour to the empty state colours (as a file input cannot be pre-filled).