From 40b73bcc94492a21fa58b3fc61f78a2168a6886c Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Tue, 17 Jul 2018 09:35:54 +0000 Subject: [PATCH] Improve metadata positioning in doc list for rtl Float the metadata to the right when on a right to left layout. Otherwise it's difficult to see how the metadata is related to the document list item heading --- CHANGELOG.md | 4 ++++ .../components/_document-list.scss | 7 ++++++- .../components/docs/document_list.yml | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66194ecee7..5e78de91eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ useful summary for people upgrading their application, not a replication of the commit log. +## Unreleased + +* Improve metadata positioning in document list for rtl layouts (PR #429) + ## 9.5.2 * Attempt to improve Google snippet display (PR #424) diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss b/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss index afd2d6fa90..dd2460adfa 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss @@ -29,9 +29,14 @@ .gem-c-document-list__attribute { @include core-14; - float: left; + display: inline-block; list-style: none; padding-right: $gutter-two-thirds; + + .direction-rtl & { + padding-right: 0; + padding-left: $gutter-two-thirds; + } } .gem-c-document-list--bottom-margin { diff --git a/app/views/govuk_publishing_components/components/docs/document_list.yml b/app/views/govuk_publishing_components/components/docs/document_list.yml index 689d2060f0..af7e72d1cf 100644 --- a/app/views/govuk_publishing_components/components/docs/document_list.yml +++ b/app/views/govuk_publishing_components/components/docs/document_list.yml @@ -116,3 +116,22 @@ examples: path: '/government/organisations/advisory-committee-on-the-microbiological-safety-of-food' context: 'moving to GOV.UK' description: "Works with 4 agencies and public bodies" + right_to_left: + data: + items: + - link: + text: 'School behaviour and attendance: parental responsibility measures' + path: '/government/publications/parental-responsibility-measures-for-behaviour-and-attendance' + description: "Statutory guidance for schools, local authorities and the police on dealing with poor attendance and behaviour in school" + metadata: + public_updated_at: 2017-01-05 14:50:33 + document_type: 'Statutory guidance' + - link: + text: 'Forestry Commission' + path: '/government/organisations/forestry-commission' + context: 'separate website' + metadata: + public_updated_at: 2017-07-19 15:01:48 + document_type: 'Organisation' + context: + right_to_left: true