-
Notifications
You must be signed in to change notification settings - Fork 334
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
Text colour for inverse button should use variable that indicates design intent #3918
Comments
Accessibility consideration: the link text colour is (and should be) one that works with text on a white background. A brand colour is likely one that is chosen to work in large background areas and decorative borders, and may not have enough contrast when used for text. So I suspect the more robust choice is for the button text to share the colour of links. |
Hmm, my concern is also that the brand colour has no guarantee of contrast when used against white—although the Notification Banner component appears to have already assumed it will, using In my mind, we might want to do something like this:
Does that sound like it'd work for the use cases described here? Footnotes
|
Related component
Button component.
Version v4.7.0 introduced an inverse button modifier (yay!), but it's hard coded to use
govuk-colour("blue")
:govuk-frontend/packages/govuk-frontend/src/govuk/components/button/_index.scss
Line 39 in 635bb3c
However, it’s not clear if this is blue because
govuk-brand-colour
is blue, or becausegovuk-link-colour
is blue. In most cases, this doesn't matter because backgrounds and links are both blue. But when the brand or link colours differ from the default, what should an inverse button look like? Should it:Context
On the Mod Design System site, the inverse button shares the same colour as the background and the link colour, which are both
#532a45
:On X-GOVUK sites, the inverse button text colour is the same as the turquoise background (brand) colour (
#2288aa
), as links are Blue (#1d70b8
):Alternatives
On the prototype masthead component, am considering whether to override the hardcoded Blue colour to share that of the masthead’s background: x-govuk/govuk-prototype-components#134
Additional information (if applicable)
Happy with whatever design decision the Design System team come up with, but the colour in the codebase should indicate the design intent behind the colour chosen for inverse buttons; either
govuk-brand-colour
orgovuk-link-colour
(but notgovuk-colour("blue")
).The text was updated successfully, but these errors were encountered: