Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Use new radio buttons and checkboxes from GOV.UK elements #249

Merged
merged 9 commits into from
Dec 9, 2016

Conversation

robinwhittleton
Copy link
Contributor

@robinwhittleton robinwhittleton commented Nov 18, 2016

This removes the existing Verify radio buttons and checkboxes implementation and replaces it with the now standard GOV.UK version. We’d previously not done this as we found our version tested better than the old implementation, but the new one is based on the same original designs as Verify and has had considerably more compatibility work put in.

Overall the buttons match the current visual style, albeit slightly larger. In the original elements design there was a grey background and padding away from the edge. This padding remained in the original Verify implementation, but now isn’t needed so some of the spacing has been decreased.

docs

The most major change is on the start page. We’ve built the new elements inputs to work regardless of user choices of background and colour (see Marian Foley’s blog post). We decided that the best way to do this was to purely use the text colour to define the colours of the input and to leave the background transparent. This is a reasonably big change for Verify and it might need some user testing before we’re satisfied that it’s the right thing to do.

start

Fixes #213

Robin Whittleton added 5 commits November 18, 2016 10:00
The reveal panel has a class of “inline” even though the options should be stacked. This is because each of the text in the options is long enough to force the next option to the next line. Removing the class will cause them to naturally stack regardless of the text.

Author: @robinwhittleton
This reverts back to the existing elements styling.

Author: @robinwhittleton
There’s a bug that removes the field border when focused in Safari and Chrome. This update to govuk_template fixes it to include the border as well as the focus ring.
This updates GOV.UK Elements to 2.2.0 which includes the new GOV.UK-wide radios and checkboxes. It also contains some minor style fixes around the integration.

In the new scheme the native radios and checkboxes are hidden with opacity:0; which breaks Capybara’s `choose` function. We can click on the label instead, but that required an update to Capybara. There are deprecation warnings, but can be fixed in a future commit.
One trivial change from have_css to have_link to match the rest of the suite. The other was around Capybara no longer needing the capybara-puma gem any more (raggi/capybara-puma#6).
@robinwhittleton
Copy link
Contributor Author

robinwhittleton commented Nov 18, 2016

Forgot to mention, this also potentially removes some CSP over-reporting by removing the onclick="" hack we had in there for old iOS. That’s no longer necessary with the new code.

Robin Whittleton added 2 commits November 29, 2016 15:42
The default radio button colour matches the text colour and background that it sits in. On Verify’s start page this is a bit of a change compared to the existing style. This block of style overrides the colours to make it look more like existing Verify.

It would be interesting to A/B test these Verify styles against the elements defaults, as they have benefits for users who want to pick their own colours.
These are dynamically inserted, but adding them statically makes for a better perf story – the custom inputs can render immediately instead of waiting for the JS to kick in.
@robinwhittleton
Copy link
Contributor Author

robinwhittleton commented Dec 1, 2016

These now match the old visual design on the start page:

screen shot 2016-12-01 at 09 38 33

We should A/B test this and the elements default version soon. The style overrides are in a small block of code in 6d0488f

@mikieet
Copy link

mikieet commented Dec 1, 2016

This all looks good from a design point of view

@richardTowers
Copy link
Contributor

:shipit:

@willp-bl
Copy link
Contributor

willp-bl commented Dec 1, 2016

Minor nit, seems slightly oval shaped?
screen shot 2016-12-01 at 09 59 22

Plus occasionally seems like there's a bit of lag, but was that the thing discussed here: alphagov/govuk_elements#363 ?

But, looks good to me :shipit:

Latest elements fixes a potential performance issue on mobile
@robinwhittleton
Copy link
Contributor Author

Lag should have been fixed by 825e2b8, so if you’re seeing it still I’d be interested in finding out where.

If that turns out to be nothing I’m happy for this to ship now.

@robinwhittleton
Copy link
Contributor Author

Re oval, I think that’s your eyes. There’s an open googly eyes bug but that doesn’t seem to be the case here 👀

@richardTowers
Copy link
Contributor

@willp-bl 's image looks squashed to me too, but I can't reproduce the issue in any of the browsers on my machine at any zoom level. Maybe it's an optical illusion?

@willp-bl
Copy link
Contributor

willp-bl commented Dec 2, 2016

Chrome says it's 38x38, but it still seems elongated/oval shaped. Might help to see it if you turn the screen 90 degrees? Perhaps it is just an artefact of how it is being drawn?

@vixus0
Copy link
Contributor

vixus0 commented Dec 2, 2016

Just to be a bit more scientific, I've modified the screenshot from @willp-bl:

Radio button pedantry

There does appear to be a pixel missing from the left and right sides of the unselected radio button. Doesn't seem to happen in my browser though.

@robinwhittleton
Copy link
Contributor Author

Huh. I'm off today but maybe you could file a bug against govuk_elements? Will look at it next week.

@robinwhittleton
Copy link
Contributor Author

Seeing as we’re having difficult replicating this problem and it’s a minor visual bug can I suggest we merge this PR anyway? I’ll leave the elements issue open and keep on investigating.

@willp-bl willp-bl merged commit 47ecffc into master Dec 9, 2016
@willp-bl willp-bl deleted the new-custom-radios branch December 9, 2016 11:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants