Created
July 24, 2013 13:53
-
-
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.
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
@mixin apply($placeholder: false) { | |
@if $placeholder { | |
@extend #{$placeholder}; | |
} | |
@else { | |
@content; | |
} | |
} |
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
@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