Skip to content

Instantly share code, notes, and snippets.

@csswizardry
Created July 6, 2015 11:32
Show Gist options
  • Select an option

  • Save csswizardry/50e0a04080eadee7d8a2 to your computer and use it in GitHub Desktop.

Select an option

Save csswizardry/50e0a04080eadee7d8a2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<ul class="c-tabs">
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link">Home</a>
</li>
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link">About</a>
</li>
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link is-current">Work</a>
</li>
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link">Contact</a>
</li>
</ul>
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
// @import "tools.mixins";
//
// This is a mixins file that we’re imagining gets imported into
// main.scss
//
// Take an array of CSS property–value pairs and loop over them.
@mixin customcss($var) {
@each $property, $value in $var {
#{$property}: unquote($value);
}
}
// endimport
// Define an array of custom CSS declarations in main.scss that we can
// ‘inject’ into our imported component.
$tabs-custom: (
border-radius: 3px,
);
// @import "components.tabs";
$tabs-custom: (
) !default;
.c-tabs {
margin: 0;
padding: 0;
list-style: none;
width: 100%;
display: table;
table-layout: fixed;
text-align: center;
background-color: #BADA55;
font-family: sans-serif;
@include customcss($tabs-custom);
}
.c-tabs__item {
display: table-cell;
}
.c-tabs__link {
display: block;
padding: 1em;
text-decoration: none;
color: #fff;
&.is-current {
text-decoration: underline;
}
}
// endimport
.c-tabs {
margin: 0;
padding: 0;
list-style: none;
width: 100%;
display: table;
table-layout: fixed;
text-align: center;
background-color: #BADA55;
font-family: sans-serif;
border-radius: 3px;
}
.c-tabs__item {
display: table-cell;
}
.c-tabs__link {
display: block;
padding: 1em;
text-decoration: none;
color: #fff;
}
.c-tabs__link.is-current {
text-decoration: underline;
}
<ul class="c-tabs">
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link">Home</a>
</li>
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link">About</a>
</li>
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link is-current">Work</a>
</li>
<li class="c-tabs__item">
<a href="#0" class="c-tabs__link">Contact</a>
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment