Skip to content

Commit

Permalink
Removes the inverse flag for contents list component
Browse files Browse the repository at this point in the history
Reverts #1037
Trello - https://trello.com/c/d9KRrVMb/207-remove-the-contents-list-inverse-option

We no longer need to use the contents list component in a topic page header

Reverts #1037
  • Loading branch information
JonathanHallam committed Sep 5, 2019
1 parent 05892d0 commit 0052a02
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 42 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

## Unreleased

* Remove the inverse flag for contents list component (PR #1090)
* Set all branded links to correct focus colour (PR #1088)
* Fix components focus state spacing (PR #1054)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,12 @@
box-shadow: 0 20px 15px -10px govuk-colour("white");
}

.gem-c-contents-list--inverse {
background: transparent;
box-shadow: none;
}

.gem-c-contents-list__title {
@include govuk-text-colour;
@include govuk-font($size: 16, $weight: regular, $line-height: 1.5);
margin: 0;
}

.gem-c-contents-list--inverse .gem-c-contents-list__title,
.gem-c-contents-list--inverse .gem-c-contents-list__link:link,
.gem-c-contents-list--inverse .gem-c-contents-list__link:visited {
color: govuk-colour("white");
}

.gem-c-contents-list--inverse .gem-c-contents-list__link:focus {
color: $govuk-focus-text-colour;
}

.gem-c-contents-list__list,
.gem-c-contents-list__nested-list {
@include govuk-text-colour;
Expand Down Expand Up @@ -90,10 +75,6 @@
}
}

.gem-c-contents-list--inverse &:before {
color: govuk-colour("white");
}

// Focus styles on IE8 and older include the
// left margin, creating an odd white box with
// orange border around the em dash.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new
format_numbers ||= false
underline_links ||= false
inverse ||= false
contents ||= []
aria_label ||= ''
nested = !!contents.find { |c| c[:items] && c[:items].any? }
Expand All @@ -20,10 +19,7 @@
<% if contents.any? %>
<nav
role="navigation"
class="gem-c-contents-list
<%= 'gem-c-contents-list--inverse' if inverse %>
<%= 'gem-c-contents-list--no-underline' unless underline_links %>
<%= brand_helper.brand_class %>"
class="gem-c-contents-list <%= 'gem-c-contents-list--no-underline' unless underline_links %> <%= brand_helper.brand_class %>"
data-module="track-click"
<% if aria_label.present? %>
aria-label="<%= aria_label %>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,3 @@ examples:
text: Guidance and regulation
- href: "#third-thing"
text: Consultations
inverse:
description: Displays with no background colour, no box shadow and white text, for use on (for example) the [inverse header](/component-guide/inverse_header)
data:
inverse: true
contents:
- href: "#item-1"
text: "Item 1"
- href: "#item-2"
text: "Item 2"
context:
dark_background: true


5 changes: 0 additions & 5 deletions spec/components/contents_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,4 @@ def assert_tracking_link(name, value, total = 1)
render_component(contents: nested_contents_list, hide_title: true)
assert_select ".gem-c-contents-list__title", false
end

it "adds an inverse class if inverse flag is passed" do
render_component(contents: nested_contents_list, inverse: true)
assert_select ".gem-c-contents-list--inverse"
end
end

0 comments on commit 0052a02

Please sign in to comment.