Created
August 12, 2015 12:37
-
-
Save KittyGiraudel/fae0424c7afb833767eb to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
/// Very dummy implementation of spaceship operator (<=>) in Sass | |
/// which returns 1, -1 or 0 depending of the result of the comparison | |
/// between values $a and $b | |
/// @link https://wiki.php.net/rfc/combined-comparison-operator | |
/// @param {Number} $a - First value | |
/// @param {Number} $b - Second value | |
/// @return {Number} - 1, 0 or -1 | |
@function spaceship($a, $b) { | |
@if $a > $b { @return 1; } | |
@if $a < $b { @return -1; } | |
@return 0; | |
} | |
.foo { | |
content: spaceship(42, 1337); | |
content: spaceship(1337, 42); | |
content: spaceship(42, 42); | |
} |
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
.foo { | |
content: -1; | |
content: 1; | |
content: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment