Last active
August 29, 2015 14:11
-
-
Save KittyGiraudel/9119f64040575af2fc21 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.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
/// Constant maps | |
/// Should not be dynamically updated. | |
/// @access private | |
/// @prop {List} TIME - List of `<time>` units | |
/// @prop {List} FREQUENCY - List of `<frequency>` units | |
/// @prop {List} ANGLE - List of `<angle>` units | |
/// @prop {List} RELATIVE_LENGTH - List of `<length>` units that are not absolute | |
/// @prop {List} ABSOLUTE_LENGTH - List of `<length>` units that are absolute | |
/// @prop {List} LENGTH - List of `<length>` units | |
/// @prop {List} PERCENTAGE - List of `<percentage>` units | |
/// @prop {List} RESOLUTION - List of `<resolution>` units | |
/// @prop {List} POSITION - List of `<position>` keywords | |
/// @prop {List} COLORS - List of `<color>` keywords | |
/// @prop {List} MEDIA - List of media types | |
/// @prop {List} MEDIA_FEATURE - List of media features | |
/// @prop {List} DISPLAY - List of `display` values | |
/// @see http://www.w3.org/TR/css3-values/ CSS Values and Units Module Level 3 | |
/// @see http://www.w3.org/TR/2011/REC-css3-color-20110607/ CSS Color Module Level 3 | |
/// @see http://dev.w3.org/csswg/mediaqueries4/ Media Queries Level 4 | |
$CONSTANTS: ( | |
'TIME': 'ms' 's', | |
'FREQUENCY': 'Hz' 'kHz', | |
'ANGLE': 'deg' 'rad' 'grad' 'turn', | |
'RELATIVE_LENGTH': 'em' 'ex' 'ch' 'rem' 'vw' 'vh' 'vmin' 'vmax', | |
'ABSOLUTE_LENGTH': 'cm' 'mm' 'in' 'px' 'pt' 'pc', | |
'LENGTH': 'cm' 'mm' 'in' 'px' 'pt' 'pc' 'em' 'ex' 'ch' 'rem' 'vw' 'vh' 'vmin' 'vmax', | |
'PERCENTAGE': '%', | |
'RESOLUTION': 'dpi' 'dpcm' 'dppx', | |
'POSITION': 'top' 'right' 'bottom' 'left' 'center', | |
'COLORS': 'aliceblue' 'antiquewhite' 'aqua' 'aquamarine' 'azure' 'beige' 'bisque' 'black' 'blanchedalmond' 'blue' 'blueviolet' 'brown' 'burlywood' 'cadetblue' 'chartreuse' 'chocolate' 'coral' 'cornflowerblue' 'cornsilk' 'crimson' 'cyan' 'darkblue' 'darkcyan' 'darkgoldenrod' 'darkgray' 'darkgreen' 'darkgrey' 'darkkhaki' 'darkmagenta' 'darkolivegreen' 'darkorange' 'darkorchid' 'darkred' 'darksalmon' 'darkseagreen' 'darkslateblue' 'darkslategray' 'darkslategrey' 'darkturquoise' 'darkviolet' 'deeppink' 'deepskyblue' 'dimgray' 'dimgrey' 'dodgerblue' 'firebrick' 'floralwhite' 'forestgreen' 'fuchsia' 'gainsboro' 'ghostwhite' 'gold' 'goldenrod' 'gray' 'green' 'greenyellow' 'grey' 'honeydew' 'hotpink' 'indianred' 'indigo' 'ivory' 'khaki' 'lavender' 'lavenderblush' 'lawngreen' 'lemonchiffon' 'lightblue' 'lightcoral' 'lightcyan' 'lightgoldenrodyellow' 'lightgray' 'lightgreen' 'lightgrey' 'lightpink' 'lightsalmon' 'lightseagreen' 'lightskyblue' 'lightslategray' 'lightslategrey' 'lightsteelblue' 'lightyellow' 'lime' 'limegreen' 'linen' 'magenta' 'maroon' 'mediumaquamarine' 'mediumblue' 'mediumorchid' 'mediumpurple' 'mediumseagreen' 'mediumslateblue' 'mediumspringgreen' 'mediumturquoise' 'mediumvioletred' 'midnightblue' 'mintcream' 'mistyrose' 'moccasin' 'navajowhite' 'navy' 'oldlace' 'olive' 'olivedrab' 'orange' 'orangered' 'orchid' 'palegoldenrod' 'palegreen' 'paleturquoise' 'palevioletred' 'papayawhip' 'peachpuff' 'peru' 'pink' 'plum' 'powderblue' 'purple' 'red' 'rebeccapurple' 'rosybrown' 'royalblue' 'saddlebrown' 'salmon' 'sandybrown' 'seagreen' 'seashell' 'sienna' 'silver' 'skyblue' 'slateblue' 'slategray' 'slategrey' 'snow' 'springgreen' 'steelblue' 'tan' 'teal' 'thistle' 'tomato' 'turquoise' 'violet' 'wheat' 'white' 'whitesmoke' 'yellow' 'yellowgreen', | |
'MEDIA': 'all' 'print' 'screen' 'speech' 'tty' 'tv' 'projection' 'handheld' 'braille' 'embossed' 'aural', | |
'MEDIA_FEATURE': 'width' 'height' 'device-width' 'device-height' 'orientation' 'aspect-ratio' 'device-aspect-ratio' 'color' 'color-index' 'monochrome' 'resolution' 'scan' 'grid' 'update-frequency' 'overflow-block' 'overflow-inline' 'inverted-colors' 'pointer' 'hover' 'any-pointer' 'any-hover' 'light-level' 'scripting', | |
'DISPLAY': 'inline' 'block' 'inline-block' 'list-item' 'inline-list-item' 'table' 'inline-table' 'table-caption' 'table-cell' 'flex' 'inline-flex' 'grid' 'inline-grid' 'ruby' 'none' 'contents' | |
) !global; | |
/// Constant getter | |
/// @access public | |
/// @require $CONSTANTS | |
/// @throw Unknown constant `#{$name}`. | |
/// @example scss - Function making sure a value is an `<angle>` | |
/// @function is-angle($value) { | |
/// @return type-of($value) == "number" and index(const("ANGLE"), unit($value)); | |
/// } | |
@function const($name) { | |
@if not map-has-key($CONSTANTS, $name) { | |
@error 'Unknown constant `#{$name}`.'; | |
} | |
@return map-get($CONSTANTS, $name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment