Skip to content
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 config to prevent automatic boldening of radio button labels in a collection #374

Conversation

peteryates
Copy link
Member

@peteryates peteryates commented Jul 17, 2022

The original behaviour of the form builder followed the examples in the Design System documentation at the time and emboldened any radio button labels when hints were present.

These examples were dropped in 2020 and the guidance changed. In the referenced PR I said I'd look into changing the behaviour in the form builder but never did.

Modifying the default would be a breaking change so we're just adding a new configuration option, default_collection_radio_buttons_auto_bold_labels, for the time being. The default will remain true for the time being but may change at the next major release.

To disable the automatic emboldening behaviour add this line to your configuration:

GOVUKDesignSystemFormBuilder.configure do |c|
  c.default_collection_radio_buttons_auto_bold_labels = false
end

Fixes #373

@netlify
Copy link

netlify bot commented Jul 17, 2022

👷 Deploy Preview for govuk-form-builder processing.

Name Link
🔨 Latest commit 42dec38
🔍 Latest deploy log https://app.netlify.com/sites/govuk-form-builder/deploys/62d7d796699ba00009d0b5b1

Copy link
Contributor

@tvararu tvararu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@peteryates peteryates force-pushed the allow-auto-boldening-of-radio-buttons-in-collection-to-be-disabled branch from cd6773d to 44bd340 Compare July 19, 2022 07:56
The original behaviour of the form builder followed the examples in the
Design System documentation at the time and emboldened any radio button
labels when hints were present.

These examples were dropped in 2020[0] and the guidance changed. In the
referenced PR I said I'd look into changing the behaviour in the form
builder but never did.

As it would be a breaking change we're just adding a new configuration
option, `default_collection_radio_buttons_auto_bold_labels`, to allow
the behaviour to be modified.

[0] alphagov/govuk-design-system#1284
@peteryates peteryates force-pushed the allow-auto-boldening-of-radio-buttons-in-collection-to-be-disabled branch from 44bd340 to 42dec38 Compare July 20, 2022 10:23
@peteryates peteryates merged commit 22999f7 into main Jul 21, 2022
@peteryates peteryates deleted the allow-auto-boldening-of-radio-buttons-in-collection-to-be-disabled branch July 21, 2022 11:08
@paulrobertlloyd
Copy link
Contributor

Brilliant, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Labels in radio button collections that include hint text are unexpectedly emboldened
3 participants