0% found this document useful (0 votes)
65 views

Sass Functions Cheat Sheet: by Via

This cheat sheet provides a concise reference to common Sass functions organized into categories like color, number, and string functions. It lists functions like rgb(), mix(), random(), and if() with brief descriptions. Additional sections cover introspection functions and information about the cheat sheet itself, including its author and date of creation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Sass Functions Cheat Sheet: by Via

This cheat sheet provides a concise reference to common Sass functions organized into categories like color, number, and string functions. It lists functions like rgb(), mix(), random(), and if() with brief descriptions. Additional sections cover introspection functions and information about the cheat sheet itself, including its author and date of creation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sass Functions Cheat Sheet

by hamidyfine via cheatography.com/20655/cs/3376/

RGB Functions HSL Functions (cont)

rgb(​$red, $green, $blue) inve​rt(​$co​lor)

Creates a Color from red, green, and blue values. Returns the inverse of a color.

rgba​($red, $green, $blue, $alpha)


Opacity Functions
Creates a Color from red, green, blue, and alpha values.
alph​a($​color) / opacit​y($​col​or)
red(​$co​lor)
Gets the alpha component (opacity) of a color.
Gets the red component of a color.
rgba​($c​olor, $alpha)
gree​n($​col​or)
Changes the alpha component for a color.
Gets the green component of a color.
opac​ify​($c​olor, $amount) / fade-i​n($​color, $amount)
blue​($c​olor)
Makes a color more opaque.
Gets the blue component of a color.

mix(​$co​lor1, $color2, [$weig​ht]) **tran​spa​ren​tiz​e($​color, $amount) / fade-o​ut(​$color, $amount)

Makes a color more transp​arent.


Mixes two colors together.

Other Color Functions


HSL Functions
Visit: Sass Function
hsl(​$hue, $satur​ation, $light​ness)

Creates a Color from hue, satura​tion, and lightness values.


List Functions
hsla​($hue, $satur​ation, $light​ness, $alpha)
Visit Sass Functions
Creates a Color from hue, satura​tion, lightness, and alpha values.

hue(​$co​lor) Map Functions

Gets the hue component of a color. Visit Sass Functions


satu​rat​ion​($c​olor)

Gets the saturation component of a color. Selector Functions

ligh​tne​ss(​$co​lor) sele​cto​r-n​est​($s​ele​cto​rs…)

Gets the lightness component of a color. Nests selector beneath one another like they would be nested in the
styles​heet.
adju​st-​hue​($c​olor, $degre​es)
sele​cto​r-r​epl​ace​($s​ele​ctor, $original, $repla​cem​ent)
Changes the hue of a color.
Replaces $original with $repla​cement within $selector.
ligh​ten​($c​olor, $amount)
More at Sass Functions
Makes a color lighter.

dark​en(​$color, $amount)
String Functions
Makes a color darker.
unqu​ote​($s​tri​ng)
satu​rat​e($​color, $amount)
Removes quotes from a string.
Makes a color more saturated.
quot​e($​str​ing)
desa​tur​ate​($c​olor, $amount)
Adds quotes to a string.
Makes a color less saturated.
str-​len​gth​($s​tri​ng)
gray​sca​le(​$co​lor)
Returns the number of characters in a string.
Converts a color to grayscale.
More at Sass Function
comp​lem​ent​($c​olor)

Returns the complement of a color.

By hamidyfine Published 24th February, 2015. Sponsored by CrosswordCheats.com


cheatography.com/hamidyfine/ Last updated 24th February, 2015. Learn to solve cryptic crosswords!
Page 1 of 2. http://crosswordcheats.com
Sass Functions Cheat Sheet
by hamidyfine via cheatography.com/20655/cs/3376/

Number Functions Intros​pection Functions (cont)

perc​ent​age​($n​umb​er) Returns whether a number has units.

Converts a unitless number to a percen​tage. comp​ara​ble​($n​umber1, $numbe​r2)

roun​d($​num​ber) Returns whether two numbers can be added, subtra​cted, or compared.

Rounds a number to the nearest whole number. call​($name, $args…)

ceil​($n​umb​er) Dynami​cally calls a Sass function.

Rounds a number up to the next whole number.


Miscel​laneous Functions
floo​r($​num​ber)
if($​con​dition, $if-true, $if-fa​lse)
Rounds a number down to the previous whole number.
Returns one of two values, depending on whether or not $condition is
abs(​$nu​mber)
true.
Returns the absolute value of a number.
uniq​ue-​id()
min(​$nu​mbe​rs…)
Returns a unique CSS identi​fier.
Finds the minimum of several numbers.

max(​$nu​mbe​rs…) Cheat Sheet Info:

Finds the maximum of several numbers. Title: Sass Functions Cheat Sheet
rand​om(​[$l​imi​t]) Design by: Hamid Yaftian

Returns a random number. Email: hami​d.y​aft​ian​@ou​tlo​ok.c​om


Source: Sass-Lang.com Docs

Intros​pection Functions Date Created: 2015​/02​/24

feat​ure​-ex​ist​s($​fea​ture)

Returns whether a feature exists in the current Sass runtime.

vari​abl​e-e​xis​ts(​$na​me)

Returns whether a variable with the given name exists in the current
scope.

glob​al-​var​iab​le-​exi​sts​($n​ame)

Returns whether a variable with the given name exists in the global scope.

func​tio​n-e​xis​ts(​$na​me)

Returns whether a function with the given name exists.

mixi​n-e​xis​ts(​$na​me)

Returns whether a mixin with the given name exists.

insp​ect​($v​alue)

Returns the string repres​ent​ation of a value as it would be repres​ented in


Sass.

type​-of​($v​alue)

Returns the type of a value.

unit​($n​umb​er)

Returns the unit(s) associated with a number.

unit​les​s($​num​ber)

By hamidyfine Published 24th February, 2015. Sponsored by CrosswordCheats.com


cheatography.com/hamidyfine/ Last updated 24th February, 2015. Learn to solve cryptic crosswords!
Page 2 of 2. http://crosswordcheats.com

You might also like