Skip to content

Instantly share code, notes, and snippets.

@zuDevonRW
Last active December 30, 2015 19:39
Show Gist options
  • Save zuDevonRW/7875852 to your computer and use it in GitHub Desktop.
Save zuDevonRW/7875852 to your computer and use it in GitHub Desktop.
Generate selectors with px and enhance to rems nicely and easily. Requires Foundation 5
@mixin px-n-rem($selector,$size)
#{$selector}: #{$size}px
#{$selector}: +rem-calc($size)
## Usage example
.something
+px-n-rem('padding', 16)
## Gives you
.something{
padding: 16px;
padding: 1rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment