Merge pull request #414 from lvuch/accordion

WIP Accordion
This commit is contained in:
Vincent Fiduccia
2018-07-11 15:50:36 -07:00
committed by GitHub
4 changed files with 95 additions and 1 deletions
+5 -1
View File
@@ -6,8 +6,8 @@
{{ end }}
{{ define "main" }}
<div class="wrapper">
<div class="row m-t-sm">
<aside class="col-sm-3 col-xs-12 p-l-0">
@@ -22,6 +22,10 @@
{{end}}
<div class="main-content">
<!-- this is a test -->
<!-- {{ partial "page-nav.html" . }} -->
<!-- end test -->
{{ .Content }}
{{ range (.Paginator 5).Pages }}
+20
View File
@@ -0,0 +1,20 @@
<div class="page-nav">
<ul>
{{ template "page-nav" . }}
</ul>
</div>
{{ define "page-nav" }}
{{ range .Sections}}
<li class=""><a href="{{ .RelPermalink}}">{{ .Title }}</a>
{{if gt (len .Sections) 0}}
<!-- <i class="material-icons expand-toggle">add_box</i> -->
<ul class="hide">
{{ range .Pages }}
<li class=""><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
{{ end }}
{{ template "page-nav" . }}
</ul>
{{end}}
</li>
{{ end }}
{{ end }}
+7
View File
@@ -0,0 +1,7 @@
<div class="tab">
<input id="{{ .Get "id" }}" type="checkbox" name="tabs">
<label for="{{ .Get "id" }}">{{ .Get "label" }}</label>
<div class="tab-content">
{{ .Inner }}
</div>
</div>
+63
View File
@@ -62,3 +62,66 @@
display: none;
visibility: hidden;
}
//accordion
.tab {
position: relative;
margin-bottom: 1px;
width: 100%;
overflow: hidden;
border: solid $border thin;
input {
position: absolute;
opacity: 0;
z-index: -1;
}
label {
position: relative;
display: block;
padding: $spacer-xs;
background: lighten($bg-default,4%);
border: solid 1px $border;
font-size: 2rem;
cursor: pointer;
}
.tab-content {
display: none;
overflow: hidden;
background: #fff;
-webkit-transition: max-height .35s;
-o-transition: max-height .35s;
transition: max-height .35s;
padding: $spacer-sm;
}
/* :checked */
input:checked~.tab-content {
display: block;
}
/* Icon */
label::after {
position: absolute;
right: $spacer-xs;
top: $spacer-xs;
display: block;
text-align: center;
-webkit-transition: all .35s;
-o-transition: all .35s;
transition: all .35s;
}
input[type=checkbox]+label::after {
content: "+";
}
input[type=radio]+label::after {
content: "\25BC";
}
input[type=checkbox]:checked+label::after {
transform: rotate(90deg);
}
input[type=radio]:checked+label::after {
transform: rotateX(180deg);
}
}