Created
November 2, 2015 07:57
-
-
Save yuezk/2439ff25afa965905132 to your computer and use it in GitHub Desktop.
PostCSS one pixel border mixin
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
/** | |
* use the postcss-mixins plugin | |
* | |
* Usage: | |
* .item { | |
* position: relative; | |
* } | |
* .item:before { | |
* content: ''; | |
* @mixin 1px top, #ddd; | |
* } | |
* .item:after { | |
* content: ''; | |
* @mixin 1px bottom, #ddd; | |
* } | |
*/ | |
@define-mixin 1px $direction: top, $color: #ccc { | |
position: absolute; | |
left: 0; | |
right: 0; | |
$(direction): 0; | |
height: 1px; | |
background: $color; | |
transform: scaleY(0.5); | |
transform-origin: $direction center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment