Skip to content

Commit

Permalink
Merge pull request #463 from alphagov/be-bold
Browse files Browse the repository at this point in the history
[Do not merge] Enable bold text in govspeak
  • Loading branch information
steventux committed Aug 6, 2018
2 parents 192af3e + cef9896 commit 8c8007f
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 39 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Add tabs component (PR #455)
* Adds styling for singular related step by step navs (PR #458)
* Add schema.org `isPartOf` links from articles to step by steps (PR #384)
* Enables bold styling in govspeak blocks, removes rich govspeak feature (PR #463)

## 9.8.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,6 @@

// Text styles

strong {
font-weight: 400;
}

// rich-govspeak is a modifier for the govspeak component
// that allows bold text. Used by the highway code manual.
&.rich-govspeak {
strong {
font-weight: bold;
}
}

em,
i {
font-style: normal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<%
direction_class = "direction-#{direction}" if local_assigns.include?(:direction)
rich_govspeak = local_assigns.fetch(:rich_govspeak) if local_assigns.include?(:rich_govspeak)
disable_youtube_expansions = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)

classes = []
classes << direction_class if direction_class
classes << "rich-govspeak" if rich_govspeak
classes << "disable-youtube" if disable_youtube_expansions
%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
govspeak_locals = {}
govspeak_locals[:content] = local_assigns.fetch(:content) if local_assigns.include?(:content)
govspeak_locals[:direction] = local_assigns.fetch(:direction) if local_assigns.include?(:direction)
govspeak_locals[:rich_govspeak] = local_assigns.fetch(:rich_govspeak) if local_assigns.include?(:rich_govspeak)
govspeak_locals[:disable_youtube_expansions] = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)
%>
<div class="gem-c-govspeak-html-publication">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,6 @@ examples:
data:
block: |
<p>This content has <strong>text in strong tags</strong>, but they are not styled as bold</p>
with_rich_govspeak:
data:
rich_govspeak: true
block: |
<p>This content uses rich govspeak and has <strong>text in strong tags</strong> that are styled as bold</p>
with_youtube_embed:
data:
block: |
Expand Down
9 changes: 0 additions & 9 deletions spec/components/govspeak_html_publication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ def component_name
assert_select ".disable-youtube h2", text: "youtube"
end

it "can enable rich govspeak" do
render_component(
rich_govspeak: true,
content: "<strong>boldly go</strong>".html_safe
)

assert_select ".rich-govspeak strong", text: 'boldly go'
end

it "accepts a block" do
render "govuk_publishing_components/components/#{component_name}" do
"content-via-block"
Expand Down
9 changes: 0 additions & 9 deletions spec/components/govspeak_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ def component_name
assert_select ".disable-youtube h2", text: "youtube"
end

it "can enable rich govspeak" do
render_component(
rich_govspeak: true,
content: "<strong>boldly go</strong>".html_safe
)

assert_select ".rich-govspeak strong", text: 'boldly go'
end

it "accepts a block" do
render "govuk_publishing_components/components/#{component_name}" do
"content-via-block"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ul>
<% end %>
<%= render 'govuk_publishing_components/components/govspeak', content: content, rich_govspeak: true %>
<%= render 'govuk_publishing_components/components/govspeak', content: content %>
</div>

<div class="column-one-third">
Expand Down

0 comments on commit 8c8007f

Please sign in to comment.