Skip to content

Commit 2b67783

Browse files
Prototyping changing colours of the File upload component to make it consistent with the new brand
1 parent 4ec0f14 commit 2b67783

File tree

1 file changed

+12
-24
lines changed
  • packages/govuk-frontend/src/govuk/components/file-upload

1 file changed

+12
-24
lines changed

packages/govuk-frontend/src/govuk/components/file-upload/_index.scss

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
$file-upload-border-width: 2px;
77
$component-padding: govuk-spacing(1);
88
$empty-button-background-colour: govuk-colour("white");
9-
$empty-status-background-colour: govuk-tint(govuk-colour("blue"), 70%);
9+
$empty-status-background-colour: govuk-colour("blue", $variant: "tint-80");
1010
$empty-pseudo-button-background-colour: govuk-colour("black", $variant: "tint-95");
1111

1212
.govuk-file-upload {
@@ -82,7 +82,8 @@
8282
display: block;
8383
margin-bottom: govuk-spacing(2);
8484
padding: govuk-spacing(3) govuk-spacing(2);
85-
background-color: govuk-colour("white");
85+
color: govuk-colour("white");
86+
background-color: govuk-colour("blue");
8687
text-align: left;
8788
}
8889

@@ -100,26 +101,26 @@
100101
// align the padding to be same as notification banner and error summary accounting for the thicker borders
101102
padding: (govuk-spacing(3) + $govuk-border-width - $file-upload-border-width);
102103
border: $file-upload-border-width govuk-colour("black", $variant: "tint-80") solid;
103-
background-color: govuk-colour("black", $variant: "tint-95");
104+
background-color: govuk-colour("white");
104105
cursor: pointer;
105106

106107
@include govuk-media-query($from: tablet) {
107108
padding: (govuk-spacing(4) + $govuk-border-width - $file-upload-border-width);
108109
}
109110

110111
.govuk-file-upload-button__pseudo-button {
111-
background-color: govuk-colour("white");
112+
background-color: govuk-colour("black", $variant: "tint-95");
112113
}
113114

114115
&:hover {
115-
background-color: govuk-tint(govuk-colour("mid-grey"), 20%);
116+
border-color: govuk-colour("black", $variant: "tint-50");
116117

117118
.govuk-file-upload-button__pseudo-button {
118-
background-color: govuk-shade(govuk-colour("light-grey"), 10%);
119+
background-color: govuk-colour("black", $variant: "tint-80");
119120
}
120121

121122
.govuk-file-upload-button__status {
122-
background-color: govuk-tint(govuk-colour("blue"), 80%);
123+
background-color: govuk-colour("blue");
123124
}
124125
}
125126

@@ -129,7 +130,7 @@
129130
outline: $govuk-focus-width solid $govuk-focus-colour;
130131
// Ensure outline appears outside of the element
131132
outline-offset: 0;
132-
background-color: govuk-tint(govuk-colour("mid-grey"), 20%);
133+
background-color: govuk-colour("black", $variant: "tint-95");
133134
// Double the border by adding its width again. Use `box-shadow` for this
134135
// instead of changing `border-width` - this is for consistency with
135136
// components such as textarea where we avoid changing `border-width` as
@@ -145,7 +146,7 @@
145146
&:hover .govuk-file-upload-button__pseudo-button {
146147
border-color: $govuk-focus-colour;
147148
outline: 3px solid transparent;
148-
background-color: govuk-colour("black", $variant: "tint-95");
149+
background-color: govuk-colour("black", $variant: "tint-80");
149150
box-shadow: inset 0 0 0 1px $govuk-focus-colour;
150151
}
151152
}
@@ -160,7 +161,7 @@
160161
}
161162

162163
.govuk-file-upload-button__status {
163-
color: govuk-shade(govuk-colour("blue"), 60%);
164+
color: govuk-colour("black");
164165
background-color: $empty-status-background-colour;
165166
}
166167

@@ -170,7 +171,7 @@
170171
background-color: govuk-colour("black", $variant: "tint-95");
171172

172173
.govuk-file-upload-button__status {
173-
background-color: govuk-tint(govuk-colour("blue"), 80%);
174+
background-color: govuk-colour("blue", $variant: "tint-80");
174175
}
175176
}
176177
}
@@ -181,22 +182,9 @@
181182

182183
// extra specificity to apply when
183184
// empty
184-
&.govuk-file-upload-button {
185-
background-color: govuk-tint(govuk-colour("mid-grey"), 20%);
186-
}
187-
188185
&.govuk-file-upload-button--empty {
189186
background-color: govuk-colour("black", $variant: "tint-95");
190187
}
191-
192-
&.govuk-file-upload-button--empty:not(:disabled) .govuk-file-upload-button__status,
193-
&.govuk-file-upload-button--empty .govuk-file-upload-button__pseudo-button {
194-
background-color: govuk-colour("white");
195-
}
196-
197-
.govuk-file-upload-button__pseudo-button {
198-
background-color: govuk-shade(govuk-colour("black", $variant: "tint-95"), 10%);
199-
}
200188
}
201189

202190
.govuk-file-upload-button:disabled {

0 commit comments

Comments
 (0)