Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #179 from thoughtbot/kf-px-to-em-function

Added px-to-em function from Neat
  • Loading branch information...
commit 9a366be768b3a38f55d938baac6e0c00a46e01a6 2 parents c38ba2d + 8054028
Phil LaPier authored
View
1  app/assets/stylesheets/_bourbon.scss
@@ -5,6 +5,7 @@
@import "functions/grid-width";
@import "functions/linear-gradient";
@import "functions/modular-scale";
+@import "functions/px-to-em";
@import "functions/radial-gradient";
@import "functions/render-gradients";
@import "functions/tint-shade";
View
8 app/assets/stylesheets/functions/_px-to-em.scss
@@ -0,0 +1,8 @@
+// Convert pixels to ems
+// eg. for a relational value of 12px write em(12) when the parent is 16px
+// if the parent is another value say 24px write em(12, 24)
+
+@function em($pxval, $base: 16) {
+ @return ($pxval / $base) * 1em;
+}
+

0 comments on commit 9a366be

Please sign in to comment.
Something went wrong with that request. Please try again.