-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add smaller versions of radio buttons and checkboxes #1125
Conversation
Nice work Dave! Feels pretty good on mobile Chrome. After selecting, the hover colour remains, is that expected? |
@dashouse can you explain the technical requirement to have them block? |
@joelanman this could be the same issue we saw when we looked to add ghost hover states before: alphagov/govuk_elements#570 (comment) |
Updated with a quick override class to block the hover state for the second example to see how we feel about the difference. @joelanman Hover colour should not remain no... I wasn't seeing this initially on iOS, but I don't see the normal focus either @NickColley It's hard to explain in words, but also near impossible to screenshot because of the cursors but... the |
I think... if you do, it works as we want? .govuk-checkboxes--small .govuk-checkboxes__label {
- display: block;
- margin-top: -2px;
padding: 11px 15px 9px 0;
}
.govuk-checkboxes--small .govuk-checkboxes__item {
min-height: 0;
padding-left: 35px;
+ float: left;
+ margin-top: -2px;
} |
Yes, this is perfect 👍 |
f7e900c
to
53dc4ae
Compare
// | ||
// (If you do use them, they won't look completely broken... but seriously, | ||
// don't use them) | ||
.govuk-radios__hint { |
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.
I wonder if 'pointer-events: none' would ensure it doesnt trigger the hover state...
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.
I'd had a similar thought, but sadly not, as the pointer events just 'go through' the hint and find the label.
83f304c
to
160cfee
Compare
160cfee
to
dedc6da
Compare
70edfe9
to
4ac2df0
Compare
- Nest small radios selectors and re-order - Improve documentation - Fix display of hints - Fix alignment of conditional reveals - Disable hover on disabled radios - General tidy up
This should be handled by autoprefixer instead.
This means that they display correctly when colours are overridden in the browser.
26fd6e8
to
23d0d71
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.
Great work everyone 🙌
Addresses alphagov/govuk-design-system-backlog#162 |
Introduces smaller versions of the radios and checkboxes components.
Despite being visually smaller, these have a target size of 44 x 44px, as the input extends outside of the boundaries of the visual control.
To make it clear which control will be activated when hovering in the gap between the controls, we add a hover state.
This PR also simplifies the way that existing checkboxes and radio buttons are rendered in IE8 and increases the touch area of the existing radios and checkboxes to 44x44px.
👉Checkbox examples in the review app
👉Radio examples in the review app
👉Radios and checkboxes, big and small, in all the states
👉A contrived example
Browser and assistive technology testing
Physical device testing
Chrome 69, Android 7.0 (Galaxy S6)
Works as expected
Chrome 50, Android 5.1.1 (Nexus 10 tablet)
Works as expected
Chrome 71, Android 4.4.2 (Galaxy Note 2)
Tested with stylus and touch. Worked as expected
Android Browser, Android 4.4.2 (Galaxy Note 2)
The stylus triggers hover style
Touch triggers the hover style, and clicking once triggers hover style then after a delay triggers the click. Not ideal but still usable.
Android 2.2 (Galaxy S)
Radios are square – seemingly no support for border-radius – an existing issue.
Small hidden element highlighted on tap. Hover state not visible.
Safari, iOS 10.3.2 (iPhone 5C)
Works as expected
Safari, iOS 9.3.2 (iPhone 5)
Works as expected
Safari, iOS 7.1.2 (iPhone 4)
Hover state is visible and 'sticks', but clicking once still triggers the control
Internet Explorer, Windows Phone 8.1 (Lumia 630)
Works as expected
Screenshots
Chrome 70 (macOS Mojave)
Chrome 70 (Windows 10)
Chrome 71 (macOS Mojave)
Chrome 71 (Windows 10)
Firefox 62 (macOS Mojave)
Firefox 62 (Windows 10)
Safari 9.1 (OS X El Capitan)
Safari 10.1 (macOS Sierra)
Safari 11.1 (macOS High Sierra)
Safari 12 (macOS Mojave)
Internet Explorer 8 (Windows 7)
Internet Explorer 9 (Windows 7)
Internet Explorer 10 (Windows 8)
Internet Explorer 11 (Windows 10)
Edge 18 (Windows 10)
Android 7.1 (Google Pixel)
Android 8.0 (Google Pixel 2)
Android 9.0 (Google Pixel 2)
iOS 8.3 (iPhone 6)
iOS 10 (iPhone 7)
iOS 11 (iPhone 8)
iOS 12 (iPhone XR)
Known issues
The hover state 'sticks' on devices that support both touch and pointer based interaction, such as Chromebooks and Surfaces.
Video showing issue
If you try to use a hint with the smaller radios and checkboxes, moving the cursor over the hint will trigger the hover state, but clicking the hint won't actually select the control.
Video showing issue