-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: first iteration of horizontal tabs
- Loading branch information
Michael
committed
Sep 7, 2017
1 parent
4a88511
commit 4d0997b
Showing
6 changed files
with
203 additions
and
65 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
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
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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// Pattern: tabs | ||
// Problem: Switching between views of grouped content | ||
|
||
.section-tabs { | ||
|
||
a:visited { | ||
color: $link-colour; | ||
} | ||
|
||
a:hover{ | ||
color: $link-hover-colour; | ||
text-decoration: underline; | ||
} | ||
|
||
@extend %contain-floats; | ||
border-bottom: 2px solid $border-colour; | ||
margin: $gutter * 2 0 $gutter; | ||
|
||
@include media(mobile) { | ||
border-bottom: none; | ||
margin: $gutter 0; | ||
} | ||
|
||
ul { | ||
position: relative; | ||
top: 2px; | ||
margin: -2px 0 0 0; | ||
padding: 0; | ||
|
||
li { | ||
margin: 0; | ||
padding: 0; | ||
float: left; | ||
display: inline; | ||
list-style: none; | ||
@include media(mobile) { | ||
float: none; | ||
display: block; | ||
} | ||
} | ||
|
||
a { | ||
@include core-19; | ||
font-weight: 700; | ||
display: block; | ||
overflow: hidden; | ||
margin: 5px 2px 6px 0; | ||
padding: 5px 0; | ||
text-decoration: underline; | ||
background: $white; | ||
border: 2px solid $white; | ||
border-bottom: none; | ||
|
||
&:hover, &:focus { | ||
background: $grey-3; | ||
color:$link-colour; | ||
text-decoration: underline; | ||
} | ||
|
||
@include media(mobile) { | ||
@include core-16; | ||
border-bottom: 2px solid $border-colour; | ||
width: 98.5%; | ||
@include calc(width, "100% - 10px"); | ||
margin: 5px 0 0 0; | ||
padding: 5px 0 5px 5px; | ||
text-decoration: underline; | ||
font-weight: normal; | ||
} | ||
|
||
@include media(tablet) { | ||
padding: 10px 15px; | ||
} | ||
|
||
@include ie(6) { | ||
float: left; | ||
} | ||
} | ||
|
||
li.active a { | ||
background: $white; | ||
margin: 0 2px 0 0; | ||
border-color: $border-colour; | ||
color: $black; | ||
text-decoration: none; | ||
cursor: hand; | ||
|
||
@include media(mobile) { | ||
border-bottom: 2px solid $border-colour; | ||
width: 98.5%; | ||
@include calc(width, "100% - 10px"); | ||
padding: 5px 0 5px 5px; | ||
margin: 5px 0 0 0; | ||
text-decoration: none; | ||
font-weight: bold; | ||
} | ||
|
||
@include media(tablet) { | ||
padding: 15px 15px 16px ; | ||
} | ||
} | ||
|
||
li.disabled a { | ||
background: $white; | ||
border-color: transparent; | ||
color: $grey-2; | ||
text-decoration: none; | ||
cursor: hand; | ||
} | ||
} | ||
} |
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
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,76 +1,87 @@ | ||
<form action="" method="" enctype="multipart/form-data"> | ||
<div class="grid-row"> | ||
<div class="column-one-third"> | ||
|
||
<!-- < CONTENT NAVIGATION > --> | ||
<ul class="tab__nav"> | ||
<li> | ||
<a href="#0" class="active" data-target="main-content"> | ||
Main content | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#0" class="" data-target="hidden-content-1"> | ||
Hidden content #1 | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#0" class="" data-target="hidden-content-2"> | ||
Hidden content #2 | ||
</a> | ||
</li> | ||
<li class="locked"> | ||
Locked content (locked) | ||
</li> | ||
<li> | ||
<hr style="margin:0"> | ||
<a href="#0" class="" data-target="hidden-content-3"> | ||
Hidden content of a different type | ||
</a> | ||
</li> | ||
</ul> | ||
<!-- </ CONTENT NAVIGATION > --> | ||
<!-- Tab 1 --> | ||
<div id="history" style="display:block;"> | ||
<div class="grid-row"> | ||
<div class="column-full"> | ||
<div class="section-tabs"> | ||
<ul> | ||
<li class="active"> | ||
<a id="open-tab">Timeline</a> | ||
</li> | ||
<li> | ||
<a id="closed-tab" onclick="show('application-form');hide('history');">Application</a> | ||
</li> | ||
<li> | ||
<a id="closed-tab" onclick="show('options');hide('history');">Actions</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="grid-row"> | ||
<div class="column-two-thirds"> | ||
<p>Timeline form</p> | ||
</div> | ||
</div> | ||
|
||
<div class="column-two-thirds"> | ||
|
||
<!-- < MAIN CONTENT > --> | ||
<div class="tab__content" id="main-content"> | ||
<h3 class="bold-medium">Main content heading</h3> | ||
<p> | ||
A 19px body copy paragraph, maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. | ||
</p> | ||
</div> | ||
<!-- < / MAIN CONTENT > --> | ||
</div> | ||
|
||
<!-- Tab 2 --> | ||
<div id="application-form" style="display:none;"> | ||
|
||
<!-- < HIDDEN CONTENT 1 > --> | ||
<div class="tab__content js-hidden" id="hidden-content-1"> | ||
<h3 class="bold-medium">Hidden content #1 heading</h3> | ||
<p> | ||
A 19px body copy paragraph, maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. | ||
</p> | ||
<div class="grid-row"> | ||
<div class="column-full"> | ||
<div class="section-tabs"> | ||
<ul> | ||
<li> | ||
<a id="closed-tab" onclick="hide('application-form');show('history');">Timeline</a> | ||
</li> | ||
<li class="active"> | ||
<a id="open-tab">Application</a> | ||
</li> | ||
<li> | ||
<a id="closed-tab" onclick="show('options');hide('application-form');">Actions</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<!-- </ HIDDEN CONTENT 1 > --> | ||
</div> | ||
|
||
<!-- < HIDDEN CONTENT 2 > --> | ||
<div class="tab__content js-hidden" id="hidden-content-2"> | ||
<h3 class="bold-medium">Hidden content #2 heading</h3> | ||
<p> | ||
A 19px body copy paragraph, maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. | ||
</p> | ||
<div class="grid-row"> | ||
<div class="column-two-thirds"> | ||
<p>Application form</p> | ||
</div> | ||
<!-- </ HIDDEN CONTENT 2 > --> | ||
</div> | ||
</div> | ||
|
||
<!-- < HIDDEN CONTENT OF A DIFFERENT TYPE > --> | ||
<div class="tab__content js-hidden" id="hidden-content-3"> | ||
<h3 class="bold-medium">Hidden content of a different type heading</h3> | ||
<p> | ||
A 19px body copy paragraph, maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. | ||
</p> | ||
<!-- Tab 3 --> | ||
<div id="options" style="display:none;"> | ||
<div class="grid-row"> | ||
<div class="column-full"> | ||
<div class="section-tabs"> | ||
<ul> | ||
<li> | ||
<a id="closed-tab" onclick="hide('options');show('history');">Timeline</a> | ||
</li> | ||
<li> | ||
<a id="closed-tab" onclick="show('application-form');hide('options');">Application</a> | ||
</li> | ||
<li class="active"> | ||
<a id="open-tab">Actions</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<!-- </ HIDDEN CONTENT OF A DIFFERENT TYPE > --> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="column-two-thirds"> | ||
<p>Actions form</p> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
</form> |
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