Skip to content

Commit

Permalink
Add toc component with markup example
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ju committed Nov 23, 2017
1 parent b9834d3 commit 0edc4d6
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
82 changes: 82 additions & 0 deletions source/components/_toc.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<nav class="app-c-toc">
<ul class="app-c-toc__section">
<li class="app-c-toc__section-item">
<a href="#">Back link</a>
</li>
<li class="app-c-toc__section-item--current">
<a href="#">Breadcrumbs</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Button</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Checkbox</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Cookie banner</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Date input</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Download links</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Error message</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Error summary</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Feedback link</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Fieldset</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">File upload</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Input</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Inset text</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Label</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Legal text</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">List</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Panel</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Phase banner</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Previous next</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Radio</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Select</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Skip link</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Table</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Tag</a>
</li>
<li class="app-c-toc__section-item">
<a href="#">Textarea</a>
</li>
</ul>
</nav>
39 changes: 39 additions & 0 deletions source/stylesheets/components/_toc.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@include exports("toc") {

.app-c-toc {
padding: 0 $govuk-gutter-half;
@include govuk-core-16;
}

.app-c-toc__section {
margin: $govuk-gutter-half 0;
padding: 0;
list-style-type: none;

a,
a:link,
a:visited {
display: block;
padding: 8px ($govuk-gutter * 2) 8px $gutter-one-third;
border-left: 4px solid transparent;
color: $govuk-link-colour;
background: inherit;
text-decoration: none;
}

a:hover {
border-left-color: $govuk-link-hover-colour;
}
}

.app-c-toc__section-item--current {
a,
a:link,
a:visited {
border-left-color: $govuk-link-colour;
background: $app-light-grey;
font-weight: bold;
}
}

}

0 comments on commit 0edc4d6

Please sign in to comment.