-
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
Reorder the navigation lists vertically #2303
Conversation
depends on how you get items back from backend, you could also add a class and do
|
I could, but I'd still need to do something with the rows. The previous version of CSS grid that IE support needs the position of the element in the grid set explicitly - both row and column - or it defaults to I did attempted to reduce the number of rules by combining them, but it was super-unreadable and not at all easy to debug. Whilst this is verbose, I think it's more understandable. |
After ticking over this I understand why you've taken this approach, considering the problem. It's better to be clear than clever. But: If a dev wants to make a change to the content in the new header which at all changes the number of items, they have to make this change in 2 places: the yml files, the big list of Could we pop in a test somewhere to try and catch these numbers? I'm not totally sure what this would look like, I guess it'd be a js test to better interrogate styling and would probs be quite complex. My thinking is that it would stop devs forgetting to at least check the scss file and update it. |
@owenatgov I've scratched my head a bit and can't find a way of testing the number of items in the localisation files against the CSS being output - so I've added a SCSS If only CSS columns worked with |
237235a
to
612dc75
Compare
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.
One final nitpick but this is basically ready to roll. I see what you mean about it being a bit knotty but I still think it's a pretty robust solution to a tricky problem. I agree it's a shame that column-layout doesn't just work properly.
...sets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss
Outdated
Show resolved
Hide resolved
612dc75
to
9ce1fec
Compare
Lists are easier to scan when each column is alphabetically sorted vertically. This is possible to do automagically with CSS columns, but Chrome doesn't like CSS columns when links are using `text-decoration-thickness` [1][2] - so another solution was needed. CSS Grid Layout has support going back to IE 10[3] and allows for vertical columns as long as the number of items in the columns are known - so when the navigation is updated the CSS controlling the grid needs to be updated. [1]: alphagov/govuk-frontend#2204 [2]: https://bugs.chromium.org/p/chromium/issues/detail?id=1190987 [3]: https://caniuse.com/css-grid
071b91b
to
cd01d9a
Compare
The mixin outputs the styles needed for the grid layout to work in IE10+ - this is quite a repetative syntax, so the mixin takes the number of items and the number of columns and works out the rest. Added comments to the pertinent parts of the navigation localisation to remind future people that they need to update the styles as well.
cd01d9a
to
ca56385
Compare
What
Changes the layout of list of links in the navigation to use CSS grid layout so that it can be alphabetically ordered vertically, rather than horizontally.
Card: https://trello.com/c/BLSqfgij
Why
Lists are easier to scan when each column is alphabetically sorted vertically. This is possible to do automagically with CSS columns, but Chrome doesn't like CSS columns when links are using
text-decoration-thickness
(Issue on GOV.UK Frontend; Issue on Chromium) - so another solution was needed.CSS Grid Layout has support going back to IE 10 and allows for vertical columns as long as the number of items in the columns are known - so when the navigation is updated the CSS controlling the grid needs to be updated.
Visual Changes
Internet Explorer 11:
Internet Explorer 10:
Fallback in Internet Explorer 9:
The list does continue - I wasn't able to capture it in a single screenshot: