Skip to content

Commit

Permalink
Fix preview partials
Browse files Browse the repository at this point in the history
  • Loading branch information
NickColley committed Aug 23, 2017
1 parent d7fcf6d commit 70bfd7d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ $border-color: #ccc;
}

.component-guide-preview {
padding: ($gutter * 1.5) $gutter $gutter;
border: 1px solid $border-colour;
position: relative;
padding: $gutter;
padding-top: ($gutter * 1.5);

&:before {
@include core-14;
Expand All @@ -101,26 +102,11 @@ $border-color: #ccc;
color: $white;
}

div[class^="govuk-"] {
&:hover {
outline: 1px solid $border-color;
box-shadow: 0 0 10px $border-color;
}
}
}

.component-guide-preview--flush {
padding: 0;
padding-top: 1em;
border: none;

&:before {
display: none;
}
}

.component-guide-preview-title {
margin-top: 1em;
margin-top: $gutter;
margin-bottom: $gutter;
@include bold-16;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<% flush ||= false %>
<div
class="
js-test-a11y
component-guide-preview
<%= "component-guide-preview--flush" if flush %>
"
>
<div class="js-test-a11y">
<%= render @component_doc.partial_path, fixture.data %>
</div>
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
<% @component_fixtures.each do |fixture| %>
<% if @component_fixtures.length > 1 %>
<h2 class="component-guide-preview-title">
<a href="<%= component_fixture_path(@component_doc.id, fixture.id) %>"><%= fixture.name %></a>
</h2>
<h2 class="component-guide-preview-title">
<a href="<%= component_fixture_path(@component_doc.id, fixture.id) %>"><%= fixture.name %></a>
</h2>
<% end %>
<%= render(
partial: @component_doc.partial_path,
locals: {
component_doc: @component_doc,
fixture: fixture,
flush: true
}
) %>
<%= render partial: "govuk_publishing_components/component_guide/component_doc/preview", locals: { component_doc: @component_doc, fixture: fixture } %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
<h2 class="component-doc-h2">How it looks</h2>
</div>

<%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, fixture: @component_doc.fixture %>
<div class="component-guide-preview">
<%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, fixture: @component_doc.fixture %>
</div>

<% if @component_doc.accessibility_criteria.present? %>
<div class="grid-row component-accessibility-criteria">
Expand All @@ -45,7 +47,9 @@
<small>(<a href="<%= component_preview_path(@component_doc.id, fixture.id) %>">preview</a>)</small>
</h3>
<%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, fixture: fixture %>
<%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, fixture: fixture %>
<div class="component-guide-preview">
<%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, fixture: fixture %>
</div>
</div>
<% end %>
</div>
Expand Down

0 comments on commit 70bfd7d

Please sign in to comment.