ministryofjustice / govuk_elements_form_builder

Form builder helper methods to develop GOV.UK elements styled applications in Ruby on Rails
https://govuk-elements-rails-guide.herokuapp.com/
MIT License
6 stars 14 forks source link

Add margin below legend via .heading-medium class #80

Open robmckinnon opened 7 years ago

robmckinnon commented 7 years ago

To obtain a bigger margin between legend text and new radio/checkbox buttons, set class .heading-medium on legend element.

This is similiar to the way the GOV.UK elements guide uses .heading-medium on the h1 elements in their examples.

Without this change the legend text appears too close to radio/checkbox buttons, due to zero margin between them.

robmckinnon commented 7 years ago

@aliuk2012 Did you get a chance to review this suggested spacing improvement? What do you think?

aliuk2012 commented 7 years ago

@robmckinnon I did, it is fairly straight forward, I'm busy thinking of how much impact this might have to those already using the gem and whether it should go into a major/minor version release.

I am testing it on a few services I know use the existing gem to see if it might have some weird effect on them

dankmitchell commented 7 years ago

This PR is a great step towards what is recommended by gov.uk element but I think the class name should be an option and not hardcoded.

gov.uk elements recommend a hidden class (visually-hidden) on the legend and then a heading outside of the fieldset so by adding the class name as an option you are giving the developer more flexibility.