-
Notifications
You must be signed in to change notification settings - Fork 20
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 issues with charts and card blocks #4341
Conversation
e698aa3
to
845b15b
Compare
- graphs were being made short everywhere, but should only be short when the minimal option is used, when the graph is in a three column layout
- make the whole row flexbox to avoid mixing grid and flexbox - set background colour of the cards to dark blue, and the chart to white, to make the heading look like it's filling the available vertical space - add min-width 0 to the cards to fix the graph not resizing problem - improve test data
845b15b
to
00704ea
Compare
00704ea
to
62c4b95
Compare
- assuming that a card always has a heading link - so easier to split it out as specific attributes than treat it as a subblock, because then we can modify it - introduce the link_cover_block option, which sets the link class to include a pseudo element that covers the whole card in a single link, removing the need to make minimal charts a link and avoiding having duplicate links - update the YAML and tests accordingly Co-authored-by: Andy Sellick <andy.sellick@digital.cabinet-office.gov.uk>
- makes the padding left/right on the card block match the same padding in the hero block text box, as they're both blue boxes with white text
- bring the text around charts in a bit, as they're currently colliding with the edge of their containing element when shown inside a card block - this option at time of writing isn't available, will be added in alphagov/govuk_publishing_components#4342
62c4b95
to
f8b3ec7
Compare
- needed to make the charts work again, currently erroring without the minimal link
@leenagupte have bumped the gem so the preview works again. I've visually checked the pages and all my changes seem to be fine, so good to review 👍 |
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.
Looks good to me! 👍 ✅
I think someone more CSS inclined should look over the style changes.
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.
Looks good to me, just one question but not a blocker.
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
display: flex; | ||
justify-content: space-between; |
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.
Curious why this changed from grid to flex? It works fine so I'm happy to approve, just curious.
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.
Good question. I initially changed it as part of investigating the problem with chart resizing. When I realised that it was equivalent I thought it might be better to keep it all as flexbox, just to avoid mixing the two.
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.
Thanks for the review 👍
What
Fix a variety of issues to do with the charts. Commits:
Why
Arising from design and accessibility reviews.
Visual changes
Fixing the height issue on
/landing-page/tasks
Fixing the resizing problem:
Refactoring to change from two links to one (hard to tell from the screenshots, easier if you just try it out)
Fixing the padding on the blue bit of the card block (it's the indentation of the 'Be kinder' heading - the change to the contents list is because I took this screenshot before rebasing)
Enable padding on the charts - note the change on the 'data table' and 'download chart data' links (dependent on a new gem version containing alphagov/govuk_publishing_components#4342)
Trello card: https://trello.com/c/VKrLuGvg