@import

@import Sass extends the CSS @import rule to allow it to import SCSS and Sass files. All imported SCSS and Sass files will be merged together into a single CSS output file. In addition, any variables or mixins defined in imported files can be used in the main file. Sass looks for other Sass files in the current directory, and the Sass file directory under Rack, Rails, or Merb. Additional search directories may be specified using the :load_paths option, or the --load-path option on the command

percentage

percentage($number) Converts a unitless number to a percentage. Examples: percentage(0.2) => 20% percentage(100px / 50px) => 200% Parameters: $number (Number) Returns: (Number) Raises: (ArgumentError) — if $number isn’t a unitless number

adjust_color

adjust_color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha]) Increases or decreases one or more properties of a color. This can change the red, green, blue, hue, saturation, value, and alpha properties. The properties are specified as keyword arguments, and are added to or subtracted from the color’s current value for that property. All properties are optional. You can’t specify both RGB properties ($red, $green, $blue) and HSL properties ($hue, $saturation,

length

length($list) Return the length of a list. This can return the number of pairs in a map as well. Examples: length(10px) => 1 length(10px 20px 30px) => 3 length((width: 10px, height: 20px)) => 2 Parameters: $list (Base) Returns: (Number)

quote

quote($string) Add quotes to a string if the string isn’t quoted, or returns the same string if it is. Examples: quote("foo") => "foo" quote(foo) => "foo" Parameters: $string (String) Returns: (String) Raises: (ArgumentError) — if $string isn’t a string

opacity

opacity($color) Returns the alpha component (opacity) of a color. This is 1 unless otherwise specified. Parameters: $color (Color) Returns: (Number) — The alpha component, between 0 and 1 Raises: (ArgumentError) — if $color isn’t a color

grayscale

grayscale($color) Converts a color to grayscale. This is identical to desaturate(color, 100%). Parameters: $color (Color) Returns: (Color) Raises: (ArgumentError) — if $color isn’t a color

unitless

unitless($number) Returns whether a number has units. Examples: unitless(100) => true unitless(100px) => false Parameters: $number (Number) Returns: (Bool) Raises: (ArgumentError) — if $number isn’t a number

Data types

Data Types SassScript supports seven main data types: numbers (e.g. 1.2, 13, 10px) strings of text, with and without quotes (e.g. "foo", 'bar', baz) colors (e.g. blue, #04a3f9, rgba(255, 0, 0, 0.5)) booleans (e.g. true, false) nulls (e.g. null) lists of values, separated by spaces or commas (e.g. 1.5em 1em 0 2em, Helvetica, Arial, sans-serif) maps from one value to another (e.g. (key1: value1, key2: value2)) SassScript also supports all other types of CSS property value, such as Unicode range

random

random random($limit) Overloads: random Return a decimal between 0 and 1, inclusive of 0 but not 1. Returns: (Number) — A decimal value. random($limit) Return an integer between 1 and $limit, inclusive of both 1 and $limit. Parameters: $limit (Number) — The maximum of the random integer to be returned, a positive integer. Returns: (Number) — An integer. Raises: (ArgumentError) — if the $limit is not 1 or greater