From b08d09553a8a5c4ba05c6d0ed0c7f0b472517c2d Mon Sep 17 00:00:00 2001 From: Jon Kirwan Date: Mon, 11 Nov 2024 12:39:48 +0000 Subject: [PATCH] Remove important metadata component --- app/assets/stylesheets/application.scss | 5 ++ .../components/_important-metadata.scss | 52 ------------------- .../components/_important_metadata.html.erb | 24 ++++----- .../components/docs/important_metadata.yml | 36 ------------- config/initializers/dartsass.rb | 1 - 5 files changed, 16 insertions(+), 102 deletions(-) delete mode 100644 app/assets/stylesheets/components/_important-metadata.scss delete mode 100644 app/views/components/docs/important_metadata.yml diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 1b1c78da7..a5bb80016 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -54,3 +54,8 @@ $govuk-include-default-font-face: false; .constrained-image { max-width: 100%; } + +.inverse-background { + background: $govuk-brand-colour; + color: govuk-colour("white"); +} diff --git a/app/assets/stylesheets/components/_important-metadata.scss b/app/assets/stylesheets/components/_important-metadata.scss deleted file mode 100644 index 3b3bb9fcd..000000000 --- a/app/assets/stylesheets/components/_important-metadata.scss +++ /dev/null @@ -1,52 +0,0 @@ -@import "govuk_publishing_components/individual_component_support"; -@import "../mixins/margins"; - -.app-c-important-metadata { - background: $govuk-brand-colour; - color: govuk-colour("white"); - padding: govuk-spacing(3); - - @include govuk-media-query($from: tablet) { - overflow: auto; - padding: govuk-spacing(4) govuk-spacing(6); - } - - @include govuk-media-query($media-type: print) { - padding: 0; - color: $govuk-text-colour; - - .govuk-link { - color: $govuk-text-colour; - } - - .app-c-important-metadata__definition { - padding-bottom: govuk-spacing(2); - } - } -} - -// this will be moved and extended into a model for general component spacing -// once this has been decided upon and other work completed, see: -// https://trello.com/c/KEkNsxG3/142-3-implement-customisable-spacing-for-components -.app-c-important-metadata--bottom-margin { - @include responsive-bottom-margin; -} - -.app-c-important-metadata__title { - font-weight: bold; - margin-bottom: 5px; -} - -.app-c-important-metadata__list { - margin: 0; -} - -.app-c-important-metadata__term { - float: left; - padding-right: govuk-spacing(1); -} - -.app-c-important-metadata__definition { - margin: 0; - font-weight: bold; -} diff --git a/app/views/components/_important_metadata.html.erb b/app/views/components/_important_metadata.html.erb index e136a55e4..83748216a 100644 --- a/app/views/components/_important_metadata.html.erb +++ b/app/views/components/_important_metadata.html.erb @@ -1,21 +1,19 @@ -<% add_app_component_stylesheet("important-metadata") %> <% title = local_assigns[:title] items = local_assigns[:items] || {} items = items.reject { |k,v| v.nil? } items = items.merge(items) { |k,v| Array(v).join(", ") } - margin_bottom_class = " app-c-important-metadata--bottom-margin" unless local_assigns[:margin_bottom] + classes = %w(inverse-background) + classes << "responsive-bottom-margin" unless local_assigns[:margin_bottom] -%> + <% if items.any? %> -
- <% if title %> - - <% end %> - -
+ <%= content_tag :div, class: classes do %> + <%= render "govuk_publishing_components/components/metadata", { + inverse: true, + other: items, + margin_bottom: 0, + title: title, + } %> + <% end %> <% end %> diff --git a/app/views/components/docs/important_metadata.yml b/app/views/components/docs/important_metadata.yml deleted file mode 100644 index 49f87725d..000000000 --- a/app/views/components/docs/important_metadata.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Important metadata -description: List of document-type specific metadata -body: | - A replacement for the [metadata component](https://govuk-static.herokuapp.com/component-guide/metadata) with only the format specific details. - - Part of the universal navigation design. - -shared_accessibility_criteria: -- link - -accessibility_criteria: | - Important metadata must: - - - have a text contrast ratio higher than 4.5:1 against the background colour to meet [WCAG AA](https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast) - -examples: - default: - data: - items: - Date of occurrence: 29 November 2013 - Aircraft category: General Aviation - Report type: Formal Report - with_multiple_items_per_thing: - data: - items: - Many things: - - First thing - - Second thing - - Third thing - with_title: - description: Used on statistics announcements to display release date changed information, [see example](https://gov.uk/government/statistics/announcements/museums-and-galleries-monthly-visits--8) - data: - title: "The release date has been changed" - items: - Previous Date: 4 February 2016 9:00pm - Reason for change: Incorrectly input as 2015 instead of 2016 diff --git a/config/initializers/dartsass.rb b/config/initializers/dartsass.rb index e2cadc570..7611ffd9b 100644 --- a/config/initializers/dartsass.rb +++ b/config/initializers/dartsass.rb @@ -5,7 +5,6 @@ "components/_contents-list-with-body.scss" => "components/_contents-list-with-body.css", "components/_download-link.scss" => "components/_download-link.css", "components/_figure.scss" => "components/_figure.css", - "components/_important-metadata.scss" => "components/_important-metadata.css", "components/_published-dates.scss" => "components/_published-dates.css", "views/_guide.scss" => "views/_guide.css", "views/_html-publication.scss" => "views/_html-publication.css",