Skip to content

Commit

Permalink
Merge pull request #5070 from alphagov/fix-conditional-checkbox-radio…
Browse files Browse the repository at this point in the history
…-alignment

Fix alignment of content in conditional checkboxes and radio buttons
  • Loading branch information
querkmachine authored Jun 14, 2024
2 parents 520f234 + 4e83cf8 commit f2f380f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ We've made fixes to GOV.UK Frontend in the following pull requests:
- [#5043: Refactor the accordion JavaScript](https://github.com/alphagov/govuk-frontend/pull/5043)
- [#5044: Remove session storage checks from accordion JavaScript](https://github.com/alphagov/govuk-frontend/pull/5044)
- [#5060: Reintroduce additional bottom margin to Error Summary content](https://github.com/alphagov/govuk-frontend/pull/5060)
- [#5070: Fix alignment of content in conditional checkboxes and radio buttons](https://github.com/alphagov/govuk-frontend/pull/5070)

## 5.4.0 (Feature release)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
// to be an even number in order to be centred under the 40px checkbox or radio.
$conditional-border-width: $govuk-border-width-narrow;
// Calculate the amount of padding needed to keep the border centered against the checkbox.
$conditional-border-padding: ($govuk-checkboxes-size / 2) - ($conditional-border-width / 2);
$conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);
// Move the border centered with the checkbox
$conditional-margin-left: $conditional-border-padding;
// Move the contents of the conditional inline with the label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ examples:
<input class="govuk-input govuk-!-width-one-third" name="contact-text-message" type="text" id="contact-text-message">
- name: with conditional item checked
screenshot: true
options:
name: how-contacted-checked
idPrefix: how-contacted-checked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
// to be an even number in order to be centred under the 40px checkbox or radio.
$conditional-border-width: $govuk-border-width-narrow;
// Calculate the amount of padding needed to keep the border centered against the radios.
$conditional-border-padding: ($govuk-radios-size / 2) - ($conditional-border-width / 2);
$conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);
// Move the border centered with the radios
$conditional-margin-left: $conditional-border-padding;
// Move the contents of the conditional inline with the label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ examples:
<input class="govuk-input govuk-!-width-one-third" name="contact-text-message" type="text" id="contact-text-message">
- name: with conditional item checked
screenshot: true
options:
idPrefix: 'how-contacted-checked'
name: 'how-contacted-checked'
Expand Down

0 comments on commit f2f380f

Please sign in to comment.