From 70945ec461f2f56442f2fcc8762c87a24a154392 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Thu, 29 Mar 2018 08:14:45 +0000 Subject: [PATCH 1/2] Contents list add underline option - change back to defaulting to not underlining any links by default - add option on a per use basis to turn underline on --- .../stylesheets/components/_contents-list.scss | 12 ++++++++++++ app/views/components/_contents-list.html.erb | 3 ++- app/views/components/docs/contents-list.yml | 11 +++++++++++ test/components/contents_list_component_test.rb | 8 +++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/components/_contents-list.scss b/app/assets/stylesheets/components/_contents-list.scss index c9cf0d5a4..5cd94a33f 100644 --- a/app/assets/stylesheets/components/_contents-list.scss +++ b/app/assets/stylesheets/components/_contents-list.scss @@ -10,6 +10,18 @@ box-shadow: 0 20px 15px -10px $white; } +.app-c-contents-list--no-underline { + .app-c-contents-list__link { + text-decoration: none; + + &:hover, + &:focus, + &:active { + text-decoration: underline; + } + } +} + .app-c-contents-list__link { .app-c-contents-list__list-item--parent > & { font-weight: bold; diff --git a/app/views/components/_contents-list.html.erb b/app/views/components/_contents-list.html.erb index 113e06d93..41d8551cf 100644 --- a/app/views/components/_contents-list.html.erb +++ b/app/views/components/_contents-list.html.erb @@ -1,5 +1,6 @@ <% format_numbers ||= false + underline_links ||= false contents ||= [] aria_label ||= '' nested = !!contents.find { |c| c[:items] && c[:items].any? } @@ -14,7 +15,7 @@ <% if contents.any? %>