diff --git a/CHANGELOG.md b/CHANGELOG.md index 304e4cbc57..176386109a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ useful summary for people upgrading their application, not a replication of the commit log. +## Unreleased +* Fixes focus state spacing on 'extensive' related navigation links ([PR #1085](https://github.com/alphagov/govuk_publishing_components/pull/1085)) + ## 20.1.0 * Add FAQPage schema ([PR #1087](https://github.com/alphagov/govuk_publishing_components/pull/1087)) diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss b/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss index da156c5da3..013c3b7172 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss @@ -51,13 +51,17 @@ @include govuk-template-link-focus-override; } +.gem-c-related-navigation__link--truncated-links { + margin-top: govuk-spacing(2); +} + .gem-c-related-navigation__toggle { @include govuk-link-common; @include govuk-link-style-no-visited-state; display: none; .js-enabled & { - display: block; + display: inline-block; } } @@ -79,6 +83,10 @@ @include govuk-template-link-focus-override; } +.gem-c-related-navigation__section-link--inline { + line-height: 1.45; +} + // reset the default browser styles .gem-c-related-navigation__link-list { padding: 0; @@ -87,8 +95,16 @@ margin-bottom: 1.25em; } -.gem-c-related-navigation__toggle-more.js-hidden { - .js-enabled & { - display: none; +.gem-c-related-navigation__toggle-more { + .gem-c-related-navigation__section-link { + @include govuk-media-query($from: tablet) { + line-height: 1.45; + } + } + + &.js-hidden { + .js-enabled & { + display: none; + } } } diff --git a/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb b/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb index 6f0a152de1..d2ae8f9bf8 100644 --- a/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +++ b/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb @@ -26,7 +26,7 @@ link_element = link_to( link[:text], link[:path], - class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link), + class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link, (index >= section_link_limit)), rel: link[:rel], lang: related_nav_helper.t_locale_check(link[:locale]), data: { @@ -60,7 +60,7 @@ -