diff --git a/packages/govuk-frontend-review/src/stylesheets/full-page-examples/campaign-page.scss b/packages/govuk-frontend-review/src/stylesheets/full-page-examples/campaign-page.scss index e5611c6f35..a81c602127 100644 --- a/packages/govuk-frontend-review/src/stylesheets/full-page-examples/campaign-page.scss +++ b/packages/govuk-frontend-review/src/stylesheets/full-page-examples/campaign-page.scss @@ -59,6 +59,7 @@ .app-danger-box { padding: govuk-spacing(6) govuk-spacing(5); + border-left: solid #fff500; border-width: 0 0 0 10px; border-image: repeating-linear-gradient( @@ -70,6 +71,7 @@ transparent 20px ) 25; + color: govuk-colour("white"); background-color: #272828; } diff --git a/packages/govuk-frontend-review/src/stylesheets/partials/_code.scss b/packages/govuk-frontend-review/src/stylesheets/partials/_code.scss index d7bc19d0b2..86f16cad41 100644 --- a/packages/govuk-frontend-review/src/stylesheets/partials/_code.scss +++ b/packages/govuk-frontend-review/src/stylesheets/partials/_code.scss @@ -6,11 +6,15 @@ .app-code__container { display: block; + margin: 0; padding: govuk-spacing(4); + overflow-x: auto; + border: $govuk-focus-width solid transparent; outline: 1px solid transparent; + background-color: govuk-colour("black", $variant: "tint-95"); @include govuk-responsive-margin(4, "bottom"); diff --git a/packages/govuk-frontend/src/govuk/components/accordion/_index.scss b/packages/govuk-frontend/src/govuk/components/accordion/_index.scss index cd3530aba2..bbc8c76119 100644 --- a/packages/govuk-frontend/src/govuk/components/accordion/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/accordion/_index.scss @@ -87,6 +87,7 @@ background: none; cursor: pointer; + -webkit-appearance: none; @media #{govuk-from-breakpoint(tablet)} { @@ -143,6 +144,7 @@ // Create Chevron icon aligned with text .govuk-accordion-nav__chevron { box-sizing: border-box; + display: inline-block; position: relative; @@ -159,7 +161,9 @@ // Create inner chevron arrow &::after { content: ""; + box-sizing: border-box; + display: block; position: absolute; @@ -201,6 +205,7 @@ text-align: left; // Section headers have a pointer cursor as an additional affordance cursor: pointer; + -webkit-appearance: none; @media #{govuk-from-breakpoint(tablet)} { @@ -356,7 +361,6 @@ @media (hover: none) { .govuk-accordion__section-header:hover { border-top-color: govuk-functional-colour(border); - box-shadow: inset 0 3px 0 0 govuk-functional-colour(link); .govuk-accordion__section-button { diff --git a/packages/govuk-frontend/src/govuk/components/back-link/_index.scss b/packages/govuk-frontend/src/govuk/components/back-link/_index.scss index f814163214..14052f9a78 100644 --- a/packages/govuk-frontend/src/govuk/components/back-link/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/back-link/_index.scss @@ -19,7 +19,6 @@ display: inline-block; position: relative; - margin-top: govuk-spacing(3); margin-bottom: govuk-spacing(3); @@ -30,6 +29,7 @@ // Prepend left pointing chevron .govuk-back-link::before { content: ""; + display: block; // Vertically align with the parent element @@ -64,6 +64,7 @@ .govuk-back-link::after { content: ""; + position: absolute; top: -14px; right: 0; diff --git a/packages/govuk-frontend/src/govuk/components/breadcrumbs/_index.scss b/packages/govuk-frontend/src/govuk/components/breadcrumbs/_index.scss index 36166ddb90..355a310871 100644 --- a/packages/govuk-frontend/src/govuk/components/breadcrumbs/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/breadcrumbs/_index.scss @@ -36,6 +36,7 @@ .govuk-breadcrumbs__list-item { display: inline-block; + position: relative; margin-bottom: govuk-spacing(1); @@ -50,6 +51,7 @@ // Create a chevron using a box with borders on two sides, rotated 45deg. &::before { content: ""; + display: block; position: absolute; diff --git a/packages/govuk-frontend/src/govuk/components/button/_index.scss b/packages/govuk-frontend/src/govuk/components/button/_index.scss index 6e8b784edb..45be776d76 100644 --- a/packages/govuk-frontend/src/govuk/components/button/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/button/_index.scss @@ -63,8 +63,11 @@ $govuk-inverse-button-text-colour: govuk-functional-colour(brand) !default; @include govuk-font($size: 19, $line-height: 19px); box-sizing: border-box; + display: inline-block; + position: relative; + width: 100%; margin-top: 0; margin-right: 0; @@ -72,14 +75,19 @@ $govuk-inverse-button-text-colour: govuk-functional-colour(brand) !default; @include govuk-responsive-margin(6, "bottom", $adjustment: $button-shadow-size); // s2 padding: (govuk-spacing(2) - $govuk-border-width-form-element) govuk-spacing(2) (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)); // s1 + border: $govuk-border-width-form-element solid transparent; border-radius: 0; + color: $govuk-button-text-colour; background-color: $govuk-button-colour; box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0 + text-align: center; vertical-align: top; + cursor: pointer; + -webkit-appearance: none; @media #{govuk-from-breakpoint(tablet)} { @@ -127,6 +135,7 @@ $govuk-inverse-button-text-colour: govuk-functional-colour(brand) !default; // button's shadow as well, in case users try to click it. &::before { content: ""; + display: block; position: absolute; @@ -236,22 +245,21 @@ $govuk-inverse-button-text-colour: govuk-functional-colour(brand) !default; @include govuk-font-size($size: 24, $line-height: 1); display: inline-flex; - min-height: auto; - justify-content: center; + min-height: auto; } .govuk-button__start-icon { - margin-left: govuk-spacing(1); - - @media #{govuk-from-breakpoint(desktop)} { - margin-left: govuk-spacing(2); - } - vertical-align: middle; flex-shrink: 0; align-self: center; + margin-left: govuk-spacing(1); + vertical-align: middle; // Work around SVGs not inheriting color from parent in forced color mode // (https://github.com/w3c/csswg-drafts/issues/6310) forced-color-adjust: auto; + + @media #{govuk-from-breakpoint(desktop)} { + margin-left: govuk-spacing(2); + } } } diff --git a/packages/govuk-frontend/src/govuk/components/checkboxes/_index.scss b/packages/govuk-frontend/src/govuk/components/checkboxes/_index.scss index 5fb7be54be..475ef7cdd0 100644 --- a/packages/govuk-frontend/src/govuk/components/checkboxes/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/checkboxes/_index.scss @@ -13,8 +13,8 @@ .govuk-checkboxes__item { display: flex; - flex-wrap: wrap; position: relative; + flex-wrap: wrap; margin-bottom: govuk-spacing(2); } @@ -27,10 +27,13 @@ // Allow the input to sit above the label, enabling its proper detection // when exploring by touch or using automation tools like Selenium z-index: 1; + width: $govuk-touch-target-size; height: $govuk-touch-target-size; margin: 0; + opacity: 0; + cursor: pointer; } @@ -44,6 +47,7 @@ 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; // remove 300ms pause on mobile touch-action: manipulation; @@ -52,13 +56,18 @@ // [ ] Check box .govuk-checkboxes__label::before { content: ""; + box-sizing: border-box; + position: absolute; top: ($govuk-touch-target-gutter / 2); left: ($govuk-touch-target-gutter / 2); + width: $govuk-checkboxes-size; height: $govuk-checkboxes-size; + border: $govuk-border-width-form-element solid currentcolor; + background: transparent; } @@ -68,22 +77,29 @@ // rotated 45 degrees .govuk-checkboxes__label::after { content: ""; + box-sizing: border-box; + position: absolute; // Use "magic numbers" to define shape and position of check mark because // the complexity of the shape makes it difficult to calculate dynamically. top: 13px; left: $govuk-checkbox-check-horizontal-position; + width: 23px; height: 12px; + transform: rotate(-45deg); + border: solid; border-width: 0 0 5px 5px; // Fix bug in IE11 caused by transform rotate (-45deg). // See: alphagov/govuk_elements/issues/518 border-top-color: transparent; + opacity: 0; + background: transparent; } diff --git a/packages/govuk-frontend/src/govuk/components/details/_index.scss b/packages/govuk-frontend/src/govuk/components/details/_index.scss index 1ca6717981..4259d2fa58 100644 --- a/packages/govuk-frontend/src/govuk/components/details/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/details/_index.scss @@ -114,6 +114,7 @@ // Append our own open / closed marker using a pseudo-element .govuk-details__summary::before { content: ""; + position: absolute; top: -1px; diff --git a/packages/govuk-frontend/src/govuk/components/error-message/_index.scss b/packages/govuk-frontend/src/govuk/components/error-message/_index.scss index f3c0ddb664..b87727a7e1 100644 --- a/packages/govuk-frontend/src/govuk/components/error-message/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/error-message/_index.scss @@ -6,7 +6,6 @@ margin-top: 0; // Reset any default browser margins for paragraphs margin-bottom: govuk-spacing(3); clear: both; - color: govuk-functional-colour(error); } } diff --git a/packages/govuk-frontend/src/govuk/components/exit-this-page/_index.scss b/packages/govuk-frontend/src/govuk/components/exit-this-page/_index.scss index ca8474e927..90c0325847 100644 --- a/packages/govuk-frontend/src/govuk/components/exit-this-page/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/exit-this-page/_index.scss @@ -27,11 +27,15 @@ .govuk-exit-this-page__indicator { @include govuk-responsive-padding(2); display: none; + padding-bottom: 0; + + pointer-events: none; + color: inherit; + line-height: 0; // removes extra negative space below the indicators text-align: center; - pointer-events: none; } .govuk-exit-this-page__indicator--visible { @@ -40,10 +44,13 @@ .govuk-exit-this-page__indicator-light { box-sizing: border-box; + display: inline-block; + width: $indicator-size; height: $indicator-size; margin: 0 0.125em; + border-width: 2px; border-style: solid; border-radius: 50%; @@ -67,6 +74,7 @@ right: 0; bottom: 0; left: 0; + background-color: govuk-colour("white"); } diff --git a/packages/govuk-frontend/src/govuk/components/fieldset/_index.scss b/packages/govuk-frontend/src/govuk/components/fieldset/_index.scss index f50b2836ef..0fd4d34ef4 100644 --- a/packages/govuk-frontend/src/govuk/components/fieldset/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/fieldset/_index.scss @@ -25,7 +25,9 @@ // 1. IE9-11 & Edge 12-13 // 2. IE8-11 box-sizing: border-box; // 1 + display: table; // 2 + max-width: 100%; // 1 margin-bottom: govuk-spacing(2); padding: 0; diff --git a/packages/govuk-frontend/src/govuk/components/file-upload/_index.scss b/packages/govuk-frontend/src/govuk/components/file-upload/_index.scss index da16d22d41..b92ebc207b 100644 --- a/packages/govuk-frontend/src/govuk/components/file-upload/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/file-upload/_index.scss @@ -41,7 +41,6 @@ // when it's a selector. &:focus-within { outline: $govuk-focus-width solid govuk-functional-colour(focus); - box-shadow: inset 0 0 0 4px govuk-functional-colour(input-border); } @@ -66,10 +65,10 @@ } .govuk-file-upload-button__pseudo-button { + flex-shrink: 0; width: auto; margin-right: govuk-spacing(2); margin-bottom: $govuk-border-width-form-element + 1; - flex-shrink: 0; } .govuk-file-upload-button__instruction { @@ -80,10 +79,13 @@ .govuk-file-upload-button__status { display: block; + margin-bottom: govuk-spacing(2); padding: govuk-spacing(3) govuk-spacing(2); + color: govuk-colour("white"); background-color: govuk-colour("blue"); + text-align: left; @include govuk-text-break-word; } @@ -93,8 +95,8 @@ // so we need a container here .govuk-file-upload-button__pseudo-button-container { display: flex; - align-items: baseline; flex-wrap: wrap; + align-items: baseline; } .govuk-file-upload-button { @@ -191,7 +193,6 @@ .govuk-file-upload-button:disabled { pointer-events: none; opacity: 0.5; - background-color: $empty-button-background-colour; .govuk-file-upload-button__pseudo-button { diff --git a/packages/govuk-frontend/src/govuk/components/footer/_index.scss b/packages/govuk-frontend/src/govuk/components/footer/_index.scss index dc1a163088..e0d397126a 100644 --- a/packages/govuk-frontend/src/govuk/components/footer/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/footer/_index.scss @@ -44,11 +44,13 @@ .govuk-footer__meta { display: flex; // Support: Flexbox - margin-right: -$govuk-gutter-half; - margin-left: -$govuk-gutter-half; + flex-wrap: wrap; // Support: Flexbox align-items: flex-end; // Support: Flexbox justify-content: center; // Support: Flexbox + + margin-right: -$govuk-gutter-half; + margin-left: -$govuk-gutter-half; } .govuk-footer__meta-item { @@ -86,13 +88,17 @@ .govuk-footer__copyright-logo::before { content: ""; + display: block; + width: 100%; padding-top: ($govuk-footer-crest-image-height + govuk-spacing(2)); + background-image: govuk-image-url("govuk-crest.svg"); background-repeat: no-repeat; background-position: 50% 0%; background-size: $govuk-footer-crest-image-width $govuk-footer-crest-image-height; + text-align: center; white-space: nowrap; @@ -170,10 +176,10 @@ } .govuk-footer__list { + column-gap: $govuk-gutter; // Support: Columns margin: 0; padding: 0; list-style: none; - column-gap: $govuk-gutter; // Support: Columns } @media #{govuk-from-breakpoint(desktop)} { diff --git a/packages/govuk-frontend/src/govuk/components/header/_index.scss b/packages/govuk-frontend/src/govuk/components/header/_index.scss index b88fafcd1a..e43b0989dd 100644 --- a/packages/govuk-frontend/src/govuk/components/header/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/header/_index.scss @@ -161,20 +161,23 @@ .govuk-header__logotype { display: inline-block; + position: relative; top: -3px; // Add a gap after the logo in case it's followed by a product name. This // gets removed later if the logotype is a :last-child. margin-right: govuk-spacing(1); + fill: currentcolor; + vertical-align: top; // Prevent readability backplate from obscuring underline in Windows High // Contrast Mode @media (forced-colors: active) { - forced-color-adjust: none; color: linktext; + forced-color-adjust: none; } // Remove the gap after the logo if there's no product name to keep hover diff --git a/packages/govuk-frontend/src/govuk/components/hint/_index.scss b/packages/govuk-frontend/src/govuk/components/hint/_index.scss index b72a0e2eae..ec1a7daf1a 100644 --- a/packages/govuk-frontend/src/govuk/components/hint/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/hint/_index.scss @@ -3,7 +3,6 @@ @include govuk-font($size: 19); margin-bottom: govuk-spacing(3); - color: govuk-functional-colour(secondary-text); } diff --git a/packages/govuk-frontend/src/govuk/components/input/_index.scss b/packages/govuk-frontend/src/govuk/components/input/_index.scss index 13ff1906c9..1a80ad925c 100644 --- a/packages/govuk-frontend/src/govuk/components/input/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/input/_index.scss @@ -7,6 +7,7 @@ @include govuk-font($size: 19); box-sizing: border-box; + width: 100%; height: govuk-px-to-rem(40px); margin-top: 0; @@ -116,18 +117,23 @@ box-sizing: border-box; // Use flexbox to align text within the prefix and suffix display: flex; + + flex: 0 0 auto; align-items: center; justify-content: center; + min-width: govuk-px-to-rem(40px); height: govuk-px-to-rem(40px); padding: govuk-spacing(1); + border: $govuk-border-width-form-element solid govuk-functional-colour(input-border); + background-color: govuk-colour("black", $variant: "tint-95"); + text-align: center; white-space: nowrap; // Emphasise non-editable status of prefixes and suffixes cursor: default; - flex: 0 0 auto; // Split prefix/suffix onto separate lines on narrow screens @media #{govuk-until-breakpoint(mobile)} { display: block; diff --git a/packages/govuk-frontend/src/govuk/components/inset-text/_index.scss b/packages/govuk-frontend/src/govuk/components/inset-text/_index.scss index 5875478cf6..ed1827f691 100644 --- a/packages/govuk-frontend/src/govuk/components/inset-text/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/inset-text/_index.scss @@ -9,7 +9,6 @@ @include govuk-responsive-margin(6, "bottom"); clear: both; - border-left: $govuk-border-width-wide solid govuk-functional-colour(border); > :first-child { diff --git a/packages/govuk-frontend/src/govuk/components/label/_index.scss b/packages/govuk-frontend/src/govuk/components/label/_index.scss index dbfeaf59a7..4592a3e6c3 100644 --- a/packages/govuk-frontend/src/govuk/components/label/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/label/_index.scss @@ -4,7 +4,6 @@ @include govuk-text-colour; display: block; - margin-bottom: govuk-spacing(1); } diff --git a/packages/govuk-frontend/src/govuk/components/notification-banner/_index.scss b/packages/govuk-frontend/src/govuk/components/notification-banner/_index.scss index 65f197a124..ef1b919143 100644 --- a/packages/govuk-frontend/src/govuk/components/notification-banner/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/notification-banner/_index.scss @@ -4,7 +4,6 @@ @include govuk-responsive-margin(8, "bottom"); border: $govuk-border-width solid govuk-functional-colour(brand); - background-color: govuk-functional-colour(brand); &:focus { @@ -38,7 +37,6 @@ $padding-tablet: govuk-spacing(4); @include govuk-text-colour; padding: govuk-spacing(3); - background-color: govuk-functional-colour(body-background); @media #{govuk-from-breakpoint(tablet)} { @@ -81,7 +79,6 @@ .govuk-notification-banner--success { border-color: govuk-functional-colour(success); - background-color: govuk-functional-colour(success); .govuk-notification-banner__link { diff --git a/packages/govuk-frontend/src/govuk/components/pagination/_index.scss b/packages/govuk-frontend/src/govuk/components/pagination/_index.scss index 2a0e5d44fc..f5f4fa6791 100644 --- a/packages/govuk-frontend/src/govuk/components/pagination/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/pagination/_index.scss @@ -5,8 +5,8 @@ @include govuk-responsive-margin(6, "bottom"); display: flex; flex-direction: column; - align-items: center; flex-wrap: wrap; + align-items: center; @media #{govuk-from-breakpoint(tablet)} { flex-direction: row; @@ -25,10 +25,13 @@ .govuk-pagination__prev { @include govuk-font(19); box-sizing: border-box; + position: relative; + min-width: 45px; min-height: 45px; padding: govuk-spacing(2) govuk-spacing(3); + float: left; // Float is ignored if flex is active for prev/next links &:hover { @@ -110,6 +113,7 @@ @media screen { &::after { content: ""; + position: absolute; top: 0; right: 0; diff --git a/packages/govuk-frontend/src/govuk/components/panel/_index.scss b/packages/govuk-frontend/src/govuk/components/panel/_index.scss index 013bab4a75..c45fb7b488 100644 --- a/packages/govuk-frontend/src/govuk/components/panel/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/panel/_index.scss @@ -3,17 +3,17 @@ @include govuk-font($size: 36); box-sizing: border-box; - margin-bottom: govuk-spacing(3); padding: govuk-spacing(7) - $govuk-border-width; - border: $govuk-border-width solid transparent; - text-align: center; @media #{govuk-until-breakpoint(tablet)} { padding: govuk-spacing(4) - $govuk-border-width; + // Support IE (autoprefixer doesn't add this as it's not a prefix) + word-wrap: break-word; + // This is an if-all-else-fails attempt to stop long words from // overflowing the container on very narrow viewports by forcing them to // break and wrap instead. This overflowing is more likely to happen when @@ -26,9 +26,6 @@ // components overflow, the user might have to scroll horizontally to view // it but the the text remains legible. overflow-wrap: break-word; - - // Support IE (autoprefixer doesn't add this as it's not a prefix) - word-wrap: break-word; } } diff --git a/packages/govuk-frontend/src/govuk/components/password-input/_index.scss b/packages/govuk-frontend/src/govuk/components/password-input/_index.scss index 759ad3c6d7..f2d6a30b4b 100644 --- a/packages/govuk-frontend/src/govuk/components/password-input/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/password-input/_index.scss @@ -42,10 +42,10 @@ } @media #{govuk-from-breakpoint(mobile)} { + flex-basis: 5em; + flex-shrink: 0; // Buttons are normally 100% wide on mobile, but we don't want that here width: auto; - flex-shrink: 0; - flex-basis: 5em; // Move the spacing from top to the left margin-top: 0; diff --git a/packages/govuk-frontend/src/govuk/components/phase-banner/_index.scss b/packages/govuk-frontend/src/govuk/components/phase-banner/_index.scss index cce3ccc5cb..def415ce43 100644 --- a/packages/govuk-frontend/src/govuk/components/phase-banner/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/phase-banner/_index.scss @@ -4,7 +4,6 @@ .govuk-phase-banner { padding-top: govuk-spacing(2); padding-bottom: govuk-spacing(2); - border-bottom: 1px solid govuk-functional-colour(border); } diff --git a/packages/govuk-frontend/src/govuk/components/radios/_index.scss b/packages/govuk-frontend/src/govuk/components/radios/_index.scss index 6eddb12a82..53772f96b1 100644 --- a/packages/govuk-frontend/src/govuk/components/radios/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/radios/_index.scss @@ -16,8 +16,8 @@ .govuk-radios__item { display: flex; - flex-wrap: wrap; position: relative; + flex-wrap: wrap; margin-bottom: govuk-spacing(2); } @@ -30,10 +30,13 @@ // Allow the input to sit above the label, enabling its proper detection // when exploring by touch or using automation tools like Selenium z-index: 1; + width: $govuk-touch-target-size; height: $govuk-touch-target-size; margin: 0; + opacity: 0; + cursor: pointer; } @@ -47,6 +50,7 @@ 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; // remove 300ms pause on mobile touch-action: manipulation; @@ -55,14 +59,19 @@ // ( ) Radio ring .govuk-radios__label::before { content: ""; + box-sizing: border-box; + position: absolute; top: ($govuk-touch-target-gutter / 2); left: ($govuk-touch-target-gutter / 2); + width: $govuk-radios-size; height: $govuk-radios-size; + border: $govuk-border-width-form-element solid currentcolor; border-radius: 50%; + background: transparent; } @@ -74,6 +83,7 @@ $radio-button-size: govuk-spacing(2); content: ""; + position: absolute; // Positioned by getting half the touch target, so we have the centre of the @@ -81,11 +91,15 @@ // the centre of the button in the centre of the input. top: (($govuk-touch-target-size / 2) - $radio-button-size); left: (($govuk-touch-target-size / 2) - $radio-button-size); + width: 0; height: 0; + border: $radio-button-size solid currentcolor; border-radius: 50%; + opacity: 0; + background: currentcolor; } diff --git a/packages/govuk-frontend/src/govuk/components/select/_index.scss b/packages/govuk-frontend/src/govuk/components/select/_index.scss index 3d3200d865..256df25eee 100644 --- a/packages/govuk-frontend/src/govuk/components/select/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/select/_index.scss @@ -16,6 +16,7 @@ max-width: 100%; height: govuk-px-to-rem(40px); padding: govuk-spacing(1); + border: $govuk-border-width-form-element solid govuk-functional-colour(input-border); // Default user agent colours for selects can have low contrast, diff --git a/packages/govuk-frontend/src/govuk/components/service-navigation/_index.scss b/packages/govuk-frontend/src/govuk/components/service-navigation/_index.scss index d86082b856..6e1724347d 100644 --- a/packages/govuk-frontend/src/govuk/components/service-navigation/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/service-navigation/_index.scss @@ -44,7 +44,6 @@ @media #{govuk-from-breakpoint(tablet)} { // inline-block is used as a fallback for browsers that don't support flexbox display: inline-block; - margin-top: 0; margin-bottom: 0; padding: govuk-spacing(4) 0; @@ -136,14 +135,20 @@ .govuk-service-navigation__toggle { @include govuk-font($size: 19, $weight: bold); display: inline-flex; + + align-items: center; + margin: govuk-spacing(2) 0; padding: 0; + border: 0; + color: $govuk-service-navigation-link-colour; background: none; + word-break: break-all; + cursor: pointer; - align-items: center; &:focus { @include govuk-focused-text; diff --git a/packages/govuk-frontend/src/govuk/components/summary-list/_index.scss b/packages/govuk-frontend/src/govuk/components/summary-list/_index.scss index 9b4db7b739..d1e36599ce 100644 --- a/packages/govuk-frontend/src/govuk/components/summary-list/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/summary-list/_index.scss @@ -192,8 +192,8 @@ @media #{govuk-from-breakpoint(tablet)} { display: flex; - justify-content: space-between; flex-wrap: nowrap; + justify-content: space-between; padding: govuk-spacing(3) govuk-spacing(4); } } @@ -212,10 +212,13 @@ @include govuk-font-size($size: 19); @include govuk-typography-weight-bold; display: flex; + flex-wrap: wrap; row-gap: 10px; + margin: govuk-spacing(1) 0; padding: 0; + list-style: none; @media #{govuk-from-breakpoint(tablet)} { diff --git a/packages/govuk-frontend/src/govuk/components/tabs/_index.scss b/packages/govuk-frontend/src/govuk/components/tabs/_index.scss index cfd68469d4..31528f5af9 100644 --- a/packages/govuk-frontend/src/govuk/components/tabs/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/tabs/_index.scss @@ -66,7 +66,9 @@ padding: govuk-spacing(2) govuk-spacing(4); float: left; + background-color: govuk-colour("black", $variant: "tint-95"); + text-align: center; &::before { @@ -105,6 +107,7 @@ &::after { content: ""; + position: absolute; top: 0; right: 0; diff --git a/packages/govuk-frontend/src/govuk/components/tag/_index.scss b/packages/govuk-frontend/src/govuk/components/tag/_index.scss index 43864ebbe9..64134d0471 100644 --- a/packages/govuk-frontend/src/govuk/components/tag/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/tag/_index.scss @@ -60,6 +60,7 @@ // The border colour always follows the text colour of tags border: 1px solid currentcolor; border-radius: 1px; + text-decoration: none; overflow-wrap: break-word; diff --git a/packages/govuk-frontend/src/govuk/components/task-list/_index.scss b/packages/govuk-frontend/src/govuk/components/task-list/_index.scss index 5c57cb05b3..c782556ae2 100644 --- a/packages/govuk-frontend/src/govuk/components/task-list/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/task-list/_index.scss @@ -20,11 +20,14 @@ // can be clickable. .govuk-task-list__item { display: table; + position: relative; + width: 100%; margin-bottom: 0; padding-top: govuk-spacing(2); padding-bottom: govuk-spacing(2); + border-bottom: 1px solid govuk-functional-colour(border); } @@ -62,7 +65,9 @@ // element, this allows the whole area to be clickable. .govuk-task-list__link::after { content: ""; + display: block; + position: absolute; top: 0; right: 0; diff --git a/packages/govuk-frontend/src/govuk/components/textarea/_index.scss b/packages/govuk-frontend/src/govuk/components/textarea/_index.scss index 4f27933cd8..7f18edbfca 100644 --- a/packages/govuk-frontend/src/govuk/components/textarea/_index.scss +++ b/packages/govuk-frontend/src/govuk/components/textarea/_index.scss @@ -7,7 +7,9 @@ @include govuk-font($size: 19, $line-height: 1.25); box-sizing: border-box; + display: block; + width: 100%; min-height: 40px; @include govuk-responsive-margin(6, "bottom"); diff --git a/packages/govuk-frontend/src/govuk/core/_typography.scss b/packages/govuk-frontend/src/govuk/core/_typography.scss index 039473ff8d..c17c21fb02 100644 --- a/packages/govuk-frontend/src/govuk/core/_typography.scss +++ b/packages/govuk-frontend/src/govuk/core/_typography.scss @@ -6,7 +6,6 @@ @include govuk-font($size: 48, $weight: bold); display: block; - margin-top: 0; @include govuk-responsive-margin(8, "bottom"); } @@ -20,7 +19,6 @@ @include govuk-font($size: 36, $weight: bold); display: block; - margin-top: 0; @include govuk-responsive-margin(6, "bottom"); } @@ -34,7 +32,6 @@ @include govuk-font($size: 24, $weight: bold); display: block; - margin-top: 0; @include govuk-responsive-margin(4, "bottom"); } @@ -48,7 +45,6 @@ @include govuk-font($size: 19, $weight: bold); display: block; - margin-top: 0; @include govuk-responsive-margin(4, "bottom"); } @@ -63,9 +59,7 @@ @include govuk-font($size: 27); display: block; - margin-bottom: govuk-spacing(1); - color: govuk-functional-colour(secondary-text); } @@ -73,7 +67,6 @@ @include govuk-font($size: 24); display: block; - margin-bottom: govuk-spacing(1); color: govuk-functional-colour(secondary-text); @@ -86,7 +79,6 @@ @include govuk-font($size: 19); display: block; - color: govuk-functional-colour(secondary-text); } diff --git a/packages/govuk-frontend/src/govuk/helpers/_font-faces.scss b/packages/govuk-frontend/src/govuk/helpers/_font-faces.scss index 76e97a9c29..6b7ece1c95 100644 --- a/packages/govuk-frontend/src/govuk/helpers/_font-faces.scss +++ b/packages/govuk-frontend/src/govuk/helpers/_font-faces.scss @@ -19,20 +19,20 @@ font-family: "GDS Transport"; font-style: normal; font-weight: normal; + font-display: fallback; src: govuk-font-url("light-94a07e06a1-v2.woff2") format("woff2"), govuk-font-url("light-f591b13f7d-v2.woff") format("woff"); - font-display: fallback; } @font-face { font-family: "GDS Transport"; font-style: normal; font-weight: bold; + font-display: fallback; src: govuk-font-url("bold-b542beb274-v2.woff2") format("woff2"), govuk-font-url("bold-affa96571d-v2.woff") format("woff"); - font-display: fallback; } } } diff --git a/packages/govuk-frontend/src/govuk/helpers/_shape-arrow.scss b/packages/govuk-frontend/src/govuk/helpers/_shape-arrow.scss index 1144af38e6..f5f43ddba2 100644 --- a/packages/govuk-frontend/src/govuk/helpers/_shape-arrow.scss +++ b/packages/govuk-frontend/src/govuk/helpers/_shape-arrow.scss @@ -37,10 +37,8 @@ @mixin govuk-shape-arrow($direction, $base, $height: null, $display: block) { display: $display; - width: 0; height: 0; - border-style: solid; border-color: transparent; // 1 @@ -52,22 +50,18 @@ @if $direction == "up" { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); // 3 - border-width: 0 $perpendicular $height; border-bottom-color: inherit; // 2 } @else if $direction == "right" { clip-path: polygon(0% 0%, 100% 50%, 0% 100%); // 3 - border-width: $perpendicular 0 $perpendicular $height; border-left-color: inherit; // 2 } @else if $direction == "down" { clip-path: polygon(0% 0%, 50% 100%, 100% 0%); // 3 - border-width: $height $perpendicular 0 $perpendicular; border-top-color: inherit; // 2 } @else if $direction == "left" { clip-path: polygon(0% 50%, 100% 100%, 100% 0%); // 3 - border-width: $perpendicular $height $perpendicular 0; border-right-color: inherit; // 2 } @else { diff --git a/packages/govuk-frontend/src/govuk/objects/_button-group.scss b/packages/govuk-frontend/src/govuk/objects/_button-group.scss index 38aa8b341a..557959747d 100644 --- a/packages/govuk-frontend/src/govuk/objects/_button-group.scss +++ b/packages/govuk-frontend/src/govuk/objects/_button-group.scss @@ -58,13 +58,13 @@ // On tablet and above, we also introduce a 'column gap' between the // buttons and links in each row and left align links @media #{govuk-from-breakpoint(tablet)} { - // Cancel out the column gap for the last item in each row - margin-right: ($horizontal-gap * -1); - flex-direction: row; flex-wrap: wrap; align-items: baseline; + // Cancel out the column gap for the last item in each row + margin-right: ($horizontal-gap * -1); + .govuk-button, .govuk-link { margin-right: $horizontal-gap; diff --git a/stylelint.config.js b/stylelint.config.js index aee9461b0c..013f1d4c30 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -30,12 +30,8 @@ module.exports = { 'length-zero-no-unit': null, 'rule-empty-line-before': null, 'selector-max-id': null, - 'shorthand-property-no-redundant-values': null, // Allow markdown `*.md` Sass bad examples - 'scss/at-if-no-null': null, - 'scss/at-import-no-partial-leading-underscore': null, - 'scss/at-import-partial-extension': null, 'scss/at-mixin-pattern': null, 'scss/at-rule-conditional-no-parentheses': null, 'scss/load-no-partial-leading-underscore': null, @@ -56,159 +52,258 @@ module.exports = { * https://github.com/hudochenkov/stylelint-order/blob/master/rules/properties-order/README.md */ 'order/properties-order': [ - 'content', - 'quotes', - - // Box-sizing - Allow here until global is decided - 'box-sizing', - - 'display', - 'visibility', - - 'position', - 'z-index', - 'top', - 'right', - 'bottom', - 'left', - - 'width', - 'min-width', - 'max-width', - 'height', - 'min-height', - 'max-height', - - 'margin', - 'margin-top', - 'margin-right', - 'margin-bottom', - 'margin-left', - - 'padding', - 'padding-top', - 'padding-right', - 'padding-bottom', - 'padding-left', - - 'float', - 'clear', - - 'overflow', - 'overflow-x', - 'overflow-y', - - 'clip', - 'clip-path', - 'zoom', - 'resize', - - 'columns', - - 'table-layout', - 'empty-cells', - 'caption-side', - 'border-spacing', - 'border-collapse', - - 'list-style', - 'list-style-position', - 'list-style-type', - 'list-style-image', - - 'transform', - 'transition', - 'animation', - - 'border', - 'border-top', - 'border-right', - 'border-bottom', - 'border-left', - - 'border-width', - 'border-top-width', - 'border-right-width', - 'border-bottom-width', - 'border-left-width', - - 'border-style', - 'border-top-style', - 'border-right-style', - 'border-bottom-style', - 'border-left-style', - - 'border-radius', - 'border-top-left-radius', - 'border-top-right-radius', - 'border-bottom-left-radius', - 'border-bottom-right-radius', - - 'border-color', - 'border-top-color', - 'border-right-color', - 'border-bottom-color', - 'border-left-color', - - 'outline', - 'outline-color', - 'outline-offset', - 'outline-style', - 'outline-width', - - 'opacity', - - // Color has been moved to ensure it appears before background - 'color', - 'background', - 'background-color', - 'background-image', - 'background-repeat', - 'background-position', - 'background-size', - 'box-shadow', - 'fill', - - 'font', - 'font-family', - 'font-size', - 'font-style', - 'font-variant', - 'font-weight', - - 'font-emphasize', - - 'letter-spacing', - 'line-height', - 'list-style', - 'word-spacing', - - 'text-align', - 'text-align-last', - 'text-decoration', - 'text-indent', - 'text-justify', - 'text-overflow', - 'text-overflow-ellipsis', - 'text-overflow-mode', - 'text-rendering', - 'text-outline', - 'text-shadow', - 'text-transform', - 'text-wrap', - 'word-wrap', - 'word-break', - - 'text-emphasis', - - 'vertical-align', - 'white-space', - 'word-spacing', - 'hyphens', - - 'src', - 'cursor', - '-webkit-appearance' + [ + { + emptyLineBefore: 'threshold', + properties: ['content', 'content-visibility', 'quotes'] + }, + { + // Box-sizing - Allow here until global is decided + emptyLineBefore: 'threshold', + properties: ['box-sizing'] + }, + { + emptyLineBefore: 'threshold', + properties: ['display', 'visibility'] + }, + { + emptyLineBefore: 'threshold', + properties: ['position', 'z-index', 'top', 'right', 'bottom', 'left'] + }, + { + emptyLineBefore: 'threshold', + properties: [ + 'flex', + 'flex-basis', + 'flex-direction', + 'flex-flow', + 'flex-grow', + 'flex-shrink', + 'flex-wrap', + 'align-content', + 'align-items', + 'align-self', + 'justify-content', + 'order', + + 'grid', + 'grid-area', + 'grid-auto-columns', + 'grid-auto-flow', + 'grid-auto-rows', + 'grid-column', + 'grid-column-end', + 'grid-column-start', + 'grid-row', + 'grid-row-end', + 'grid-row-start', + 'grid-template', + 'grid-template-areas', + 'grid-template-columns', + 'grid-template-rows', + + 'columns', + 'column-count', + 'column-fill', + 'column-gap', + 'column-rule', + 'column-rule-color', + 'column-rule-style', + 'column-rule-width', + 'column-span', + 'column-width', + 'row-gap' + ] + }, + { + emptyLineBefore: 'threshold', + properties: [ + 'width', + 'min-width', + 'max-width', + 'height', + 'min-height', + 'max-height', + + 'margin', + 'margin-top', + 'margin-right', + 'margin-bottom', + 'margin-left', + + 'padding', + 'padding-top', + 'padding-right', + 'padding-bottom', + 'padding-left' + ] + }, + { + emptyLineBefore: 'threshold', + properties: ['float', 'clear', 'overflow', 'overflow-x', 'overflow-y'] + }, + { + emptyLineBefore: 'threshold', + properties: ['clip', 'clip-path', 'zoom', 'resize'] + }, + { + emptyLineBefore: 'threshold', + properties: [ + 'table-layout', + 'empty-cells', + 'caption-side', + 'border-spacing', + 'border-collapse' + ] + }, + { + emptyLineBefore: 'threshold', + properties: [ + 'list-style', + 'list-style-position', + 'list-style-type', + 'list-style-image' + ] + }, + { + emptyLineBefore: 'threshold', + properties: ['transform', 'transition', 'animation'] + }, + { + emptyLineBefore: 'threshold', + properties: [ + 'border', + 'border-top', + 'border-right', + 'border-bottom', + 'border-left', + + 'border-width', + 'border-top-width', + 'border-right-width', + 'border-bottom-width', + 'border-left-width', + + 'border-style', + 'border-top-style', + 'border-right-style', + 'border-bottom-style', + 'border-left-style', + + 'border-radius', + 'border-top-left-radius', + 'border-top-right-radius', + 'border-bottom-left-radius', + 'border-bottom-right-radius', + + 'border-color', + 'border-top-color', + 'border-right-color', + 'border-bottom-color', + 'border-left-color', + + 'border-image', + + 'outline', + 'outline-color', + 'outline-offset', + 'outline-style', + 'outline-width' + ] + }, + { + emptyLineBefore: 'threshold', + properties: ['pointer-events', 'opacity'] + }, + { + // Color has been moved to ensure it appears before background + emptyLineBefore: 'threshold', + properties: [ + 'color', + 'background', + 'background-color', + 'background-image', + 'background-repeat', + 'background-position', + 'background-size', + 'box-shadow', + 'fill', + + 'mask', + 'mask-border', + 'mask-border-mode', + 'mask-border-outset', + 'mask-border-repeat', + 'mask-border-slice', + 'mask-border-source', + 'mask-border-width', + 'mask-clip', + 'mask-composite', + 'mask-image', + 'mask-mode', + 'mask-origin', + 'mask-repeat', + 'mask-position', + 'mask-size', + 'mask-type' + ] + }, + { + emptyLineBefore: 'threshold', + properties: [ + 'font', + 'font-family', + 'font-size', + 'font-style', + 'font-variant', + 'font-weight', + 'font-emphasize', + 'font-display', + 'src', + + 'letter-spacing', + 'line-height', + 'word-spacing', + + 'text-align', + 'text-align-last', + 'text-decoration', + 'text-decoration-thickness', + 'text-decoration-skip-ink', + 'text-decoration-skip', + 'text-indent', + 'text-justify', + 'text-overflow', + 'text-overflow-ellipsis', + 'text-overflow-mode', + 'text-rendering', + 'text-outline', + 'text-shadow', + 'text-transform', + 'text-wrap', + 'word-wrap', + 'word-break', + 'overflow-wrap', + + 'text-emphasis', + + 'vertical-align', + 'white-space', + 'word-spacing', + 'hyphens', + 'user-select', + 'forced-color-adjust' + ] + }, + { + emptyLineBefore: 'threshold', + properties: ['cursor', '-webkit-appearance'] + } + ], + { + emptyLineBeforeUnspecified: 'threshold', + emptyLineMinimumPropertyThreshold: 6 + } ] } }