Skip to content

Commit

Permalink
Merge pull request #4784 from alphagov/libsass-calc
Browse files Browse the repository at this point in the history
Fix LibSass `calc()` compatibility in Radios and Checkboxes
  • Loading branch information
colinrotherham authored Feb 20, 2024
2 parents 448b449 + 20b1555 commit 91816c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/govuk/components/checkboxes/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// container minus the input width minus the padding on either side of
// the label. This prevents the label from going onto the next line due to
// __item using flex-wrap because we want hints on a separate line.
max-width: calc(100% - (($govuk-checkboxes-label-padding-left-right * 2) + $govuk-touch-target-size));
max-width: calc(100% - #{(($govuk-checkboxes-label-padding-left-right * 2) + $govuk-touch-target-size)});
margin-bottom: 0;
padding: (govuk-spacing(1) + $govuk-border-width-form-element) govuk-spacing(3);
cursor: pointer;
Expand Down
2 changes: 1 addition & 1 deletion src/govuk/components/radios/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// container minus the input width minus the padding on either side of
// the label. This prevents the label from going onto the next line due to
// __item using flex-wrap because we want hints on a separate line
max-width: calc(100% - ($govuk-radios-label-padding-left-right + $govuk-touch-target-size + govuk-spacing(3)));
max-width: calc(100% - #{($govuk-radios-label-padding-left-right + $govuk-touch-target-size + govuk-spacing(3))});
margin-bottom: 0;
padding: (govuk-spacing(1) + $govuk-border-width-form-element) govuk-spacing(3);
cursor: pointer;
Expand Down
4 changes: 4 additions & 0 deletions tasks/build/release.unit.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ describe('dist/', () => {
expect(stylesheet).not.toMatch(/body:before{content:/)
})

it('should not contain Sass variables', () => {
expect(stylesheet).not.toContain('$govuk-')
})

it('should contain the copyright notice', () => {
expect(stylesheet).toContain(
'/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */'
Expand Down

0 comments on commit 91816c5

Please sign in to comment.