Last active
August 29, 2015 14:17
-
-
Save daphotron/b0514a9225841bb08036 to your computer and use it in GitHub Desktop.
Slanted tab navigation http://sassmeister.com/gist/b0514a9225841bb08036
This file contains hidden or 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
<ul class="tab"> | |
<li> | |
<a href="#">Tab Item</a> | |
</li> | |
<li class="active"> | |
<a href="#">Tab Item</a> | |
</li> | |
<li> | |
<a href="#">Tab Item</a> | |
</li> | |
</ul> |
This file contains hidden or 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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
$size-width-tab-angle: 15px; | |
a { | |
text-decoration: none; | |
} | |
.tab { | |
display: block; | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
li { | |
display: inline-block; | |
} | |
a { | |
background: seagreen; | |
color: #fff; | |
display: block; | |
height: 15px; | |
padding: 15px 25px; | |
position: relative; | |
&:hover { | |
background: darken(seagreen, 20%); | |
} | |
} | |
a { | |
margin-left: $size-width-tab-angle; | |
margin-right: $size-width-tab-angle; | |
&:after { | |
width: 0; | |
height: 0; | |
border-top: 45px solid transparent; | |
border-left: $size-width-tab-angle solid darken(seagreen, 20%); | |
content: ''; | |
right: -$size-width-tab-angle; | |
margin: 0; | |
position: absolute; | |
bottom: 0; | |
} | |
&:before { | |
width: 0; | |
height: 0; | |
border-top: 45px solid transparent; | |
border-right: $size-width-tab-angle solid darken(seagreen, 20%); | |
content: ''; | |
left: -$size-width-tab-angle; | |
margin: 0; | |
position: absolute; | |
bottom: 0; | |
} | |
} | |
.active a { | |
background: darken(seagreen, 20%); | |
} | |
} |
This file contains hidden or 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
a { | |
text-decoration: none; | |
} | |
.tab { | |
display: block; | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
} | |
.tab li { | |
display: inline-block; | |
} | |
.tab a { | |
background: seagreen; | |
color: #fff; | |
display: block; | |
height: 15px; | |
padding: 15px 25px; | |
position: relative; | |
} | |
.tab a:hover { | |
background: #153e27; | |
} | |
.tab a { | |
margin-left: 15px; | |
margin-right: 15px; | |
} | |
.tab a:after { | |
width: 0; | |
height: 0; | |
border-top: 45px solid transparent; | |
border-left: 15px solid #153e27; | |
content: ''; | |
right: -15px; | |
margin: 0; | |
position: absolute; | |
bottom: 0; | |
} | |
.tab a:before { | |
width: 0; | |
height: 0; | |
border-top: 45px solid transparent; | |
border-right: 15px solid #153e27; | |
content: ''; | |
left: -15px; | |
margin: 0; | |
position: absolute; | |
bottom: 0; | |
} | |
.tab .active a { | |
background: #153e27; | |
} |
This file contains hidden or 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
<ul class="tab"> | |
<li> | |
<a href="#">Tab Item</a> | |
</li> | |
<li class="active"> | |
<a href="#">Tab Item</a> | |
</li> | |
<li> | |
<a href="#">Tab Item</a> | |
</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment