Skip to content

Instantly share code, notes, and snippets.

@cahnory
Created July 24, 2013 13:53
Show Gist options
  • Save cahnory/6070806 to your computer and use it in GitHub Desktop.
Save cahnory/6070806 to your computer and use it in GitHub Desktop.
Apply donne la possibilité d'utiliser @extend ou @include facilement. Il permet de définir un comportement par défaut au sein d'une mixin et d'en forcer un autre au besoin, facilement.
@mixin apply($placeholder: false) {
@if $placeholder {
@extend #{$placeholder};
}
@else {
@content;
}
}
@mixin outsight($extend: true) {
@include apply($extend and '%vendor__plasticss__mixin__outsight') {
border: none;
clip: rect(0,0,0,0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
}
// !placeholders
@if import--once('vendors/plasticss/mixin/outsight') {// small function to avoir duplicate css
%vendor__plasticss__mixin__outsight {
@include outsight(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment