-
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
Center text and icons vertically in the option select component #4256
base: main
Are you sure you want to change the base?
Conversation
09177bf
to
3857241
Compare
3857241
to
bdf6355
Compare
bdf6355
to
bebabea
Compare
bebabea
to
ab06156
Compare
ab06156
to
9defca8
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.
Changes look good to me overall, and the approach seems consistent with those made to the expander component in finder-frontend.
Just one thing which is likely worth looking at further in relation to the icon size.
@@ -76,11 +76,9 @@ | |||
|
|||
.gem-c-option-select__icon { |
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 thing that could happen when switching to use flex for the layout is that the icon will shrink depending on the length of the text, for example:
One possible option to stop the icon from shrinking is to add flex: 0 0 30px
. I imagine the same CSS rule would then need to be added to the expander component in finder-frontend.
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.
Ah good spot, thanks! I've added a flex-shrink: 0
to solve this rather than your suggestion, as it avoids the need to update the number if the size of the icon changes. @MartinJJones
9defca8
to
31b6df3
Compare
The font size of this element increased with the typography changes deployed in a recent update to `govuk-frontend`. This means that the up/down icons no longer align vertically. This PR centers the icons with the text for better vertical balance. A new container for the icon and button is also required so that the selected counter element can be styled independently. This also supports the same change made in `finder-frontend` where search filter titles had the same tweak to icon positions. See the PR at alphagov/finder-frontend#3334.
31b6df3
to
c4d5065
Compare
Thanks @MartinJJones , I've made the fix you suggested, would you be able to take a look and approve? Many thanks. |
What
Vertically centre align the toggle icons with the label in Option Selects. Trello
Why
The font size of this element increased with the typography changes deployed in a recent update to
govuk-frontend
. This means that the up/down icons no longer align vertically. This PR vertically centres the icons with the text for better vertical balance. A new container for the icon and button is also required so that the selected counter element can be styled independently.This also supports the same change made in
finder-frontend
where search filter titles had the same tweak to icon positions. See the PR at alphagov/finder-frontend#3334.Visual Changes