diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f0c53a02b..18097cf149 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ## Unreleased +* Fix Feedback component layout on mobile ([#1211](https://github.com/alphagov/govuk_publishing_components/pull/1207)) + * Fix header environment label layout on mobile ([PR #1212](https://github.com/alphagov/govuk_publishing_components/pull/1212)) ## 21.13.2 diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss b/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss index 8f3cf2fd8e..7865cd29d8 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss @@ -64,11 +64,9 @@ .gem-c-feedback__prompt-link { @include govuk-link-common; @include govuk-font(19); - margin-left: govuk-spacing(3); @include govuk-media-query($from: tablet) { @include govuk-font(16); - float: left; // needed to ensure vertical alignment consistent with prompt-link--wrong margin-left: govuk-spacing(2); } } @@ -82,20 +80,6 @@ } } -.gem-c-feedback__prompt-link--wrong { - display: block; - clear: both; - margin-top: govuk-spacing(3); - margin-left: 0; - - @include govuk-media-query($from: tablet) { - float: right; - clear: none; - margin-top: 0; - margin-left: govuk-spacing(2); - } -} - .gem-c-feedback__error-summary { margin-bottom: govuk-spacing(3); padding: govuk-spacing(3); @@ -203,3 +187,78 @@ margin: 0; padding: 0; } + + +.js-enabled { + .gem-c-feedback__js-prompt-questions { + @include govuk-media-query($until: tablet) { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 140)); + grid-template-rows: repeat(2, auto); + } + } + + .gem-c-feedback__prompt-question { + @include govuk-media-query($until: tablet) { + grid-area: 1 / 1; + } + } + + .gem-c-feedback__option-list { + list-style-type: none; + margin: 0; + padding: 0; + + @include govuk-media-query($until: tablet) { + grid-area: 1 / 1 / 2 / 3; + display: grid; + grid-template-columns: repeat(2, minmax(140px, 140px)); + grid-template-rows: repeat(2, auto); + // older grid spec + grid-row-gap: govuk-spacing(3); + // newer grid spec + row-gap: govuk-spacing(3); // sass-lint:disable-line no-misspelled-properties + } + } + + .gem-c-feedback__option-list-item { + @include govuk-media-query($from: tablet) { + float: left; + } + } + + .gem-c-feedback__option-list-item--useful { + @include govuk-media-query($until: tablet) { + display: inline-block; + @supports (display: grid) { + grid-area: 1 / 2; + padding-left: govuk-spacing(3); + } + } + } + + .gem-c-feedback__option-list-item--not-useful { + @include govuk-media-query($until: tablet) { + display: inline-block; + @supports (display: grid) { + grid-area: 1 / 2; + padding-left: 50px; + } + } + } + + .gem-c-feedback__option-list-item--wrong { + @include govuk-media-query($until: tablet) { + display: block; + margin-top: govuk-spacing(3); + @supports (display: grid) { + margin-top: 0; + grid-area: 2 / 1 / 2 / 3; + } + } + + @include govuk-media-query($from: tablet) { + float: right; + } + } +} diff --git a/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb b/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb index e06a3f5249..223ff0703d 100644 --- a/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +++ b/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb @@ -20,9 +20,9 @@ Maybe <% end %>