Skip to content

Instantly share code, notes, and snippets.

@KittyGiraudel
Created September 10, 2014 10:02
Show Gist options
  • Select an option

  • Save KittyGiraudel/5c4237518e62754e4a0a to your computer and use it in GitHub Desktop.

Select an option

Save KittyGiraudel/5c4237518e62754e4a0a to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
/**
* Check whether `$list` contains `$value`.
* @param {List} $list - List of values.
* @param {*} $value - Value to check in the list.
* @return {Bool}
*/
@function contains($list, $value) {
@return not not index($list, $value);
}
/**
* Check whether `$value` is a valid length.
* @param {*} $value - Value to validate.
* @return {Bool}
*/
@function is-length($value) {
@return contains(0 "auto" "initial" "inherit", $value)
or type-of($value) == "number" and not unitless($value)
or str-slice($value + "", 1, 4) == "calc";
}
/**
* Check whether `$value` is a valid size.
* @param {*} $value - Value to validate.
* @return {Bool}
* @requires {function} is-length
*/
@function is-size($value) {
@return is-length($value)
or contains("fill" "fit-content" "min-content" "max-content", $value);
}
/**
* Check whether `$list` contains `$value`.
* @param {List} $list - List of values.
* @param {*} $value - Value to check in the list.
* @return {Bool}
*/
/**
* Check whether `$value` is a valid length.
* @param {*} $value - Value to validate.
* @return {Bool}
*/
/**
* Check whether `$value` is a valid size.
* @param {*} $value - Value to validate.
* @return {Bool}
* @requires {function} is-length
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment