From 836377d65e874d0996302d44375d5cfee272bc4c Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Wed, 1 Apr 2020 08:59:06 +0100 Subject: [PATCH 1/2] Use individual component sass --- app/assets/stylesheets/application.scss | 36 ++++++++++++++++++++++++- app/assets/stylesheets/print.scss | 17 +++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 34358ea9a..4e52c6656 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -4,7 +4,41 @@ $govuk-typography-use-rem: false; $govuk-use-legacy-palette: false; // Components from govuk_publishing_components gem -@import 'govuk_publishing_components/all_components'; +@import 'govuk_publishing_components/govuk_frontend_support'; +@import 'govuk_publishing_components/component_support'; +@import 'govuk_publishing_components/components/attachment'; +@import 'govuk_publishing_components/components/back-link'; +@import 'govuk_publishing_components/components/breadcrumbs'; +@import 'govuk_publishing_components/components/button'; +@import 'govuk_publishing_components/components/contents-list'; +@import 'govuk_publishing_components/components/contextual-sidebar'; +@import 'govuk_publishing_components/components/details'; +@import 'govuk_publishing_components/components/document-list'; +@import 'govuk_publishing_components/components/error-message'; +@import 'govuk_publishing_components/components/error-summary'; +@import 'govuk_publishing_components/components/feedback'; +@import 'govuk_publishing_components/components/fieldset'; +@import 'govuk_publishing_components/components/govspeak'; +@import 'govuk_publishing_components/components/govspeak-html-publication'; +@import 'govuk_publishing_components/components/heading'; +@import 'govuk_publishing_components/components/hint'; +@import 'govuk_publishing_components/components/input'; +@import 'govuk_publishing_components/components/inverse-header'; +@import 'govuk_publishing_components/components/label'; +@import 'govuk_publishing_components/components/lead-paragraph'; +@import 'govuk_publishing_components/components/metadata'; +@import 'govuk_publishing_components/components/notice'; +@import 'govuk_publishing_components/components/organisation-logo'; +@import 'govuk_publishing_components/components/previous-and-next-navigation'; +@import 'govuk_publishing_components/components/radio'; +@import 'govuk_publishing_components/components/related-navigation'; +@import 'govuk_publishing_components/components/share-links'; +@import 'govuk_publishing_components/components/step-by-step-nav'; +@import 'govuk_publishing_components/components/step-by-step-nav-header'; +@import 'govuk_publishing_components/components/step-by-step-nav-related'; +@import 'govuk_publishing_components/components/subscription-links'; +@import 'govuk_publishing_components/components/title'; +@import 'govuk_publishing_components/components/translation-nav'; // government-frontend mixins @import 'mixins/margins'; diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index f29683709..0c7721361 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -1,2 +1,17 @@ -@import 'govuk_publishing_components/all_components_print'; +@import 'govuk_publishing_components/govuk_frontend_support'; +@import 'govuk_publishing_components/components/print/attachment'; +@import 'govuk_publishing_components/components/print/back-link'; +@import 'govuk_publishing_components/components/print/button'; +@import 'govuk_publishing_components/components/print/contents-list'; +@import 'govuk_publishing_components/components/print/feedback'; +@import 'govuk_publishing_components/components/print/govspeak'; +@import 'govuk_publishing_components/components/print/govspeak-html-publication'; +@import 'govuk_publishing_components/components/print/metadata'; +@import 'govuk_publishing_components/components/print/share-links'; +@import 'govuk_publishing_components/components/print/step-by-step-nav'; +@import 'govuk_publishing_components/components/print/step-by-step-nav-header'; +@import 'govuk_publishing_components/components/print/subscription-links'; +@import 'govuk_publishing_components/components/print/title'; +@import 'govuk_publishing_components/components/print/translation-nav'; + @import 'print/html-publication'; From d8c0f3651009c75c1d3bb524c46310cdce1978a6 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Mon, 6 Apr 2020 14:22:24 +0100 Subject: [PATCH 2/2] Use warning component on travel advice page - this was previously built using styles from the warning component but not the component itself - component could not be used because this part of the page required a heading - component has since been upgraded to include an option to display as a heading, so can now be used --- app/assets/stylesheets/application.scss | 11 +++++++++- .../content_items/travel_advice.html.erb | 20 ++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 4e52c6656..057617338 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -39,6 +39,7 @@ $govuk-use-legacy-palette: false; @import 'govuk_publishing_components/components/subscription-links'; @import 'govuk_publishing_components/components/title'; @import 'govuk_publishing_components/components/translation-nav'; +@import 'govuk_publishing_components/components/warning-text'; // government-frontend mixins @import 'mixins/margins'; @@ -87,10 +88,18 @@ $govuk-use-legacy-palette: false; background-color: govuk-colour("light-grey"); border: 1px solid $govuk-border-colour; margin-bottom: govuk-spacing(7); - padding: govuk-spacing(4) govuk-spacing(4) 0 govuk-spacing(9); position: relative; } +.travel-advice-notice__header { + padding: govuk-spacing(4) govuk-spacing(4) 0 govuk-spacing(3); +} + +.travel-advice-notice__content { + margin-top: - govuk-spacing(3); + padding: 0 govuk-spacing(4) 0 govuk-spacing(9); +} + .travel-advice-notice__icon { margin-left: govuk-spacing(3); } diff --git a/app/views/content_items/travel_advice.html.erb b/app/views/content_items/travel_advice.html.erb index 9d5951c95..7836656e1 100644 --- a/app/views/content_items/travel_advice.html.erb +++ b/app/views/content_items/travel_advice.html.erb @@ -16,13 +16,19 @@ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
- -

- COVID-19 Exceptional Travel Advisory Notice -

-

- As countries respond to the COVID-19 pandemic, including travel and border restrictions, the FCO advises British nationals against all but essential international travel. Any country or area may restrict travel without notice. If you live in the UK and are currently travelling abroad, you are strongly advised to return now, where and while there are still commercial routes available. Many airlines are suspending flights and many airports are closing, preventing flights from leaving. -

+
+ <%= render "govuk_publishing_components/components/warning_text", { + text: "COVID-19 Exceptional Travel Advisory Notice", + text_assistive: "Important", + large_font: true, + heading_level: 2 + } %> +
+
+

+ As countries respond to the COVID-19 pandemic, including travel and border restrictions, the FCO advises British nationals against all but essential international travel. Any country or area may restrict travel without notice. If you live in the UK and are currently travelling abroad, you are strongly advised to return now, where and while there are still commercial routes available. Many airlines are suspending flights and many airports are closing, preventing flights from leaving. +

+