Skip to content

Commit

Permalink
Some adjustments based on code review
Browse files Browse the repository at this point in the history
Remove unnecessary CSS rule and simplify the logic to make cleanup
easier in the next steps
  • Loading branch information
danacotoran committed May 7, 2021
1 parent a72ab5e commit e00ca31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "govuk/components/radios/radios";

.gem-c-radio__heading-text,
.govuk-fieldset__legend h1 {
.gem-c-radio__heading-text {
margin: 0 0 govuk-spacing(4) 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
small ||= false
inline ||= false
is_page_heading ||= false
heading_lvl = is_page_heading ? 'h1' : shared_helper.get_heading_level
heading_classes = %w(govuk-fieldset__heading)
heading_classes << "gem-c-radio__heading-text" if heading_lvl == 'h1'

if ['s', 'm', 'l', 'xl'].include?(heading_size)
size = heading_size
Expand Down Expand Up @@ -49,11 +52,9 @@
<% if heading.present? %>
<%= tag.legend class: legend_classes do %>
<%= tag.span(heading_caption, class: "govuk-caption-#{size}") if heading_caption.present? %>
<%= tag.h1 heading, class: "gem-c-radio__heading-text govuk-fieldset__heading" if is_page_heading %>
<%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-fieldset__heading") unless is_page_heading %>
<%= content_tag(heading_lvl, heading, class: heading_classes) %>
<% end %>
<% end %>

<% if description.present? %>
<%= tag.div description, class: "govuk-body" %>
<% end %>
Expand Down

0 comments on commit e00ca31

Please sign in to comment.