-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add options to govspeak blocks for controlling vertical margins
- Loading branch information
1 parent
c541786
commit ff254b8
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
<%- | ||
margin_top = block.data["margin_top"] | ||
margin_bot = block.data["margin_bottom"] | ||
|
||
classes = "" | ||
classes << "govuk-!-margin-top-#{margin_top} " if margin_top | ||
classes << "govuk-!-margin-bottom-#{margin_bot} " if margin_bot | ||
%> | ||
<% if classes.present? %> | ||
<div class="<%= classes %>"> | ||
<% end %> | ||
<%= render "govuk_publishing_components/components/govspeak", { inverse: block.data["inverse"] } do %> | ||
<%= block.data["content"].html_safe %> | ||
<% end %> | ||
<% if classes.present? %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters