Skip to content

Instantly share code, notes, and snippets.

@csswizardry
Last active December 16, 2015 13:38
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 csswizardry/d2ec30844c93f41a8f54 to your computer and use it in GitHub Desktop.
Save csswizardry/d2ec30844c93f41a8f54 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<a href="#0" class="c-btn">
<span class="c-btn__text">Close</span>
</a>
<hr />
<a href="#0" class="c-btn is-icon">
<span class="c-btn__icon">X</span>
<span class="c-btn__text">Close</span>
</a>
<hr />
<a href="#0" class="c-btn">
<span class="c-btn__icon">X</span>
<span class="c-btn__text">Close</span>
</a>
// ----
// Sass (v3.4.20)
// Compass (v1.0.3)
// ----
@mixin hide($style: 'physically') {
@if ($style == 'physically') {
display: none;
} @elseif ($style == 'visually') {
visibility: hidden;
} @elseif ($style == 'accessibly') {
position: absolute !important;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
}
}
.c-btn {
&.is-icon .c-btn__text {
@include hide('accessibly');
}
}
.c-btn.is-icon .c-btn__text {
position: absolute !important;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
}
<a href="#0" class="c-btn">
<span class="c-btn__text">Close</span>
</a>
<hr />
<a href="#0" class="c-btn is-icon">
<span class="c-btn__icon">X</span>
<span class="c-btn__text">Close</span>
</a>
<hr />
<a href="#0" class="c-btn">
<span class="c-btn__icon">X</span>
<span class="c-btn__text">Close</span>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment