Created
June 25, 2014 01:10
-
-
Save Phize/28a2665ab30142df49b0 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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
// ---- | |
// Sass (v3.3.8) | |
// Compass (v1.0.0.alpha.19) | |
// ---- | |
// Sass: Type hinting with function. | |
// by https://twitter.com/phize | |
// Dependency Injection: @content injection | |
// http://sassmeister.com/gist/3686b8eb3462fef52013 | |
// Dependency Injection: Mixin injection | |
// http://sassmeister.com/gist/5122325c0c29889b91c3 | |
// Polymorphic components: | |
// http://sassmeister.com/gist/1a10ec1c1556dfd3d6b5 | |
@function is-spacing($value) { | |
@if length($value) >= 1 and length($value) <= 4 { | |
@return true; | |
} | |
// You may also test the unit of value. | |
@return false; | |
} | |
// spacing pseudo-type | |
@function spacing($value) { | |
@if not is-spacing($value) { | |
@warn "throw an exception here."; | |
} | |
@return $value; | |
} | |
@mixin margin($value) { | |
margin: spacing(10px); | |
} | |
.margin { | |
@include margin( spacing(10px) ); | |
// You may also crate and use px(): | |
// @include margin( spacing( px(10) ) ); | |
} |
This file contains 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
.margin { | |
margin: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment