Skip to content

Instantly share code, notes, and snippets.

@aolko
Created January 26, 2016 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aolko/b0b7573070dafcf2ca3a to your computer and use it in GitHub Desktop.
Save aolko/b0b7573070dafcf2ca3a to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="tabs-wrap">
<nav id="tabs">
<a href="#" class="tab">
<span>Tab 1</span>
</a>
<a href="#" class="tab">
<span>Tab 2</span>
</a>
</nav>
</div>
<div id="page">
Lorem Ipsum dolor sit amet ...
</div>
// ----
// Sass (v3.4.20)
// Compass (v1.0.3)
// ----
body {
background-color: #000;
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: 16px;
}
.tabs-wrap{
.tab {
height: 50px;
width: 150px;
//border-radius: 15px 15px 0px 0px;
color:white;
background-color: #555;
position: relative;
top: 10px;
left: 30px;
display: inline-block;
z-index: 2;
//margin-left:5px;
&:before {
height: 50px;
width: 30px;
//border-radius: 10px 10px 0px 0px;
content: "";
position: absolute;
left: -15px;
top: 0px;
-webkit-transform: skewX(-30deg);
transform: skewX(-30deg);
z-index: -1;
background-color:#555;
}
&:after {
height: 50px;
width: 30px;
//border-radius: 10px 10px 0px 0px;
content: "";
position: absolute;
left: 135px;
top: 0px;
-webkit-transform: skewX(-30deg);
transform: skewX(-30deg);
z-index: -1;
background-color:#555;
}
&:hover {
color: black;
background-color: #fff;
transition: 0.3s ease-out;
&:before {
background-color: #fff;
transition: 0.3s ease-out;
}
&:after {
background-color: #fff;
transition: 0.3s ease-out;
}
}
&.active{
color:black !important;
background-color: white !important;
&:before {
background-color: white !important;
}
&:after {
background-color: white !important;
}
}
&:nth-of-type(2) {
background-color: #555;
top: 10px;
left: 56px;
z-index: 1;
color: #EEE;
&:before {
background-color: #555;
}
&:after {
background-color: #555;
-webkit-transform: skewX(0deg);
transform: skewX(0deg);
}
&:hover {
color: black;
background-color: #fff;
transition: 0.3s ease-out;
&:before {
background-color: #fff;
transition: 0.3s ease-out;
}
&:after {
background-color: #fff;
transition: 0.3s ease-out;
}
}
}
}
.tabs:last-child{
-webkit-transform: skewX(0deg);
transform: skewX(0deg);
}
span {
display: inline-block;
width: 150px;
text-align: center;
height: 50px;
line-height: 50px;
z-index: 3;
}
}
#page {
background-color: white;
height: calc(100vh - 120px);
width: calc(100vw - 61px);
position: relative;
top: 10px;
left: 1px;
padding: 30px;
}
body {
background-color: #000;
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: 16px;
}
.tabs-wrap .tab {
height: 50px;
width: 150px;
color: white;
background-color: #555;
position: relative;
top: 10px;
left: 30px;
display: inline-block;
z-index: 2;
}
.tabs-wrap .tab:before {
height: 50px;
width: 30px;
content: "";
position: absolute;
left: -15px;
top: 0px;
-webkit-transform: skewX(-30deg);
transform: skewX(-30deg);
z-index: -1;
background-color: #555;
}
.tabs-wrap .tab:after {
height: 50px;
width: 30px;
content: "";
position: absolute;
left: 135px;
top: 0px;
-webkit-transform: skewX(-30deg);
transform: skewX(-30deg);
z-index: -1;
background-color: #555;
}
.tabs-wrap .tab:hover {
color: black;
background-color: #fff;
transition: 0.3s ease-out;
}
.tabs-wrap .tab:hover:before {
background-color: #fff;
transition: 0.3s ease-out;
}
.tabs-wrap .tab:hover:after {
background-color: #fff;
transition: 0.3s ease-out;
}
.tabs-wrap .tab.active {
color: black !important;
background-color: white !important;
}
.tabs-wrap .tab.active:before {
background-color: white !important;
}
.tabs-wrap .tab.active:after {
background-color: white !important;
}
.tabs-wrap .tab:nth-of-type(2) {
background-color: #555;
top: 10px;
left: 56px;
z-index: 1;
color: #EEE;
}
.tabs-wrap .tab:nth-of-type(2):before {
background-color: #555;
}
.tabs-wrap .tab:nth-of-type(2):after {
background-color: #555;
-webkit-transform: skewX(0deg);
transform: skewX(0deg);
}
.tabs-wrap .tab:nth-of-type(2):hover {
color: black;
background-color: #fff;
transition: 0.3s ease-out;
}
.tabs-wrap .tab:nth-of-type(2):hover:before {
background-color: #fff;
transition: 0.3s ease-out;
}
.tabs-wrap .tab:nth-of-type(2):hover:after {
background-color: #fff;
transition: 0.3s ease-out;
}
.tabs-wrap .tabs:last-child {
-webkit-transform: skewX(0deg);
transform: skewX(0deg);
}
.tabs-wrap span {
display: inline-block;
width: 150px;
text-align: center;
height: 50px;
line-height: 50px;
z-index: 3;
}
#page {
background-color: white;
height: calc(100vh - 120px);
width: calc(100vw - 61px);
position: relative;
top: 10px;
left: 1px;
padding: 30px;
}
<div class="tabs-wrap">
<nav id="tabs">
<a href="#" class="tab">
<span>Tab 1</span>
</a>
<a href="#" class="tab">
<span>Tab 2</span>
</a>
</nav>
</div>
<div id="page">
Lorem Ipsum dolor sit amet ...
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment