-
Notifications
You must be signed in to change notification settings - Fork 332
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
Improvements to inverse components #3925
Conversation
f76954a
to
ef9d72f
Compare
Would you mind giving this a review please @paulrobertlloyd? Especially with your colour variations suggestion in mind #3918 (comment) @querkmachine Shall we get designer feedback on the hard-coded things? |
Thanks for the prompt @colinrotherham. After plentiful yak shaving, I have updated my prototype masthead component, and added an option to set a value for Playing with these 2 values, I foresee an issue, namely this: What does ‘inverse’ mean? Does it mean:
or does it mean:
I believe the intention is the former, but in the examples provided so far, the later. Ah themeing, it's a big ’ol bag of worms! I foresee 2 options:
|
"Text on a known background colour" is probably closest to how I've been imagining it, though not necessarily a known dark background colour. If the brand colour is quite light, then the inverse colour will probably be darker. But then that makes me think that you're right in that it's more practically an inverse of the brand colour, other than a universal constant. That might be the safer assumption to make, here. |
My thinking currently is to:
This might feel a little redundant, as The helper, breadcrumbs and back link are a bit harder to pin down. Although they are likely to be used on the brand colour, there isn't a guarantee that they will. We use the inverse link style on red in our review app, for example. If I may be so bold as to nullify my own work, there may be more value in only making the changes to allow the button colour customisation and to save the rest until we have a more comprehensive idea on how we want to implement theming. |
A few different use cases and concepts are getting combined here:
…with an added complication that the inverse button is itself inversely coloured 🤪 For the former, perhaps it makes sense to continue using private variables or hard-coded values (i.e. the header text should be hard-coded to use white because the header background has been hard-coded to use black). Does I think the later is the use case these inverse components best address, for which there are plentiful examples in the wild, and where this formalisation would help. Having a This is making my head hurt a bit. There’s quite a few hypotheticals being thrown into the mix, too - helpful to test robustness of approach, but perhaps a case of great being the enemy of good? Maybe this is something to get some other (fresher) eyes on? 👀 |
Having given time for others on the team to contribute if they so wished, and having mulled this over a little, I think this PR is going to be closed in favour of #4043 for the time being. Over the last few weeks we've had a lot of questions around theming, implementing dark modes, and deeper customisation of Frontend. In my mind it makes sense to tackle all of those together, but the team is already in the midst of radical architecture changes and refactoring for our upcoming v5 release, and I don't think we want to add this to the bucket at this time, even if this PR represents only a small part of a greater vision. I'd really like to revisit this in future, potentially during or after we migrate to the Sass module system (#1791), as the way that works really lends itself well to theming and customisation. This isn't a 'no', just a 'not yet'. Hopefully #4043 resolves the most pressing issue with the inverse button component! |
Understandable; once you start digging into the weeds of this, it gets complicated very quickly, and lots of assumptions and unknowns come in to play. Hopefully #4043 improves things, if only by a tiny bit, and having the new inverse components in the first place is already a massive step forward. Thanks for taking the time to noodle on this ❤️ |
Makes some improvements to how we handle colours for 'inverse' components, which are intended to be used on dark background colours.
Includes the changes discussed in #3918.
Changes
$govuk-inverse-text-colour
.govuk-link-style-inverse
mixin to use the new variable.govuk-colour("blue")
to$govuk-brand-colour
.govuk-colour("white")
to$govuk-inverse-text-colour
.$govuk-inverse-button-text-colour
and$govuk-inverse-button-background-colour
.Not changed
$govuk-inverse-text-colour
. This includes:white
onblack
white
ongreen
white
ongreen
white
onblack
Thoughts
white
on$govuk-brand-colour
, despite there being no guarantee that the brand colour provides sufficient contrast. This seems like it could be an oversight. Does it need looking into?