Skip to content

Commit

Permalink
Use collapsible breadcrumbs from govuk-frontend
Browse files Browse the repository at this point in the history
This feature has been ported to govuk-frontend
alphagov/govuk-frontend#1754
  • Loading branch information
alex-ju committed Aug 18, 2020
1 parent 2fca57e commit 5260157
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,8 @@
border-color: govuk-colour("white");
}

.gem-c-breadcrumbs--collapse-on-mobile {
.govuk-breadcrumbs--collapse-on-mobile {
@include govuk-media-query($until: tablet) {
.govuk-breadcrumbs__list {
display: flex;
}

.govuk-breadcrumbs__list-item:not(:last-child):not(:first-child) {
display: none;
}

.govuk-breadcrumbs__list-item {
padding-top: 14px;
padding-bottom: 14px;
Expand All @@ -48,10 +40,10 @@
.govuk-breadcrumbs__link:after {
content: "";
position: absolute;
top: -14px;
top: 0;
right: 0;
left: 0;
bottom: -14px;
bottom: 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)

classes = "gem-c-breadcrumbs govuk-breadcrumbs"
classes << " gem-c-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
classes << " govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
classes << " gem-c-breadcrumbs--inverse" if inverse
%>

Expand Down
2 changes: 1 addition & 1 deletion spec/components/breadcrumbs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ def assert_link_with_text_in(selector, link, text)
],
)

assert_select(".gem-c-breadcrumbs.govuk-breadcrumbs.gem-c-breadcrumbs--collapse-on-mobile")
assert_select(".gem-c-breadcrumbs.govuk-breadcrumbs.govuk-breadcrumbs--collapse-on-mobile")
end
end
2 changes: 1 addition & 1 deletion spec/components/contextual_breadcrumbs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def set_live_taxons(content_item)
content_item = remove_curated_related_item(content_item)
content_item = set_live_taxons(content_item)
render_component(content_item: content_item)
assert_select ".gem-c-breadcrumbs.gem-c-breadcrumbs--collapse-on-mobile"
assert_select ".gem-c-breadcrumbs.govuk-breadcrumbs--collapse-on-mobile"
end

it "renders breadcrumbs that don't collapse on mobile if flag is passed" do
Expand Down

0 comments on commit 5260157

Please sign in to comment.