The core functions of Vulcan

base

functions

exists

Since 1.0.0 - undefined
@function exists($dependencies) { ... }
View source

Description

checks for dependant mixins or functions

Parameters

parameter Name parameter Description parameter Type parameter Default value
$dependencies

names of functions and mixins to check for

List, String none

Returns

Bool, False

Example

 exists(test-function);
 exists(test-function, another-test-function);

Throws

  • Sorry, you entered invalid parameter for $dependencies.

  • Unmet dependencies! The following functions are required: $missing-dependencies.

invoke

Since 1.0.0 - undefined
@function invoke($callback, $conf: ()) { ... }
View source

Description

calls a function after requires and parameters are checked for validity

Parameters

parameter Name parameter Description parameter Type parameter Default value
$callback

function to call without braces

String none
$conf

configuration object defining params, types and requires

Map ()

Returns

Callback

Example

 $conf: (
     params: $value,
     types: any
 ):
 invoke(unit-strip, $conf);
 $conf: (
   params: $list,
   types: list string //$list must be list or string
 );
invoke(list-count-values, $conf);
$conf: (
    params: ($list, $function, $args),
    types: (list, string, args), //$list must be list, $function must be string, $args must be args
);
invoke(sl-some,$conf);

Requires

Used by

throw

Since 1.0.0 - undefined
@function throw($message) { ... }
View source

Description

Throws an error message and returns it as an error. If $quiet is enabled it will throw a warning and return false instead.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$message

error message

String none

Example

 throw('invalid parameter')

checks

functions

is-bool

Since 1.0.0 - undefined
@function is-bool($var) { ... }
View source

Description

Tests whether $var is bool.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for bool type

Literal none

Returns

Bool

Example

 is-bool(true)    //returns true
 is-bool(false)   //returns true
 is-bool(test)    //returns false
 is-bool(1)       //returns false
 is-bool(null)    //returns false

Used by

is-color

Since 1.0.0 - undefined
@function is-color($var) { ... }
View source

Description

Tests whether $var is color.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for color type

Literal none

Returns

Bool

Example

 is-color(#333)   //returns true
 is-color(black)  //returns true
 is-color(test)   //returns false

Used by

is-empty

Since 1.0.0 - undefined
@function is-empty($var) { ... }
View source

Description

Tests whether $var is empty.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for emptiness

Literal none

Returns

Bool

Example

 is-empty('')     //returns true
 is-empty(())     //returns true
 is-empty('test') //returns false

Used by

is-float

Since 1.0.0 - undefined
@function is-float($var) { ... }
View source

Description

Tests whether $var is float.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for float type

Literal none

Returns

Bool

Example

 is-float(-1.5) //returns true
 is-float(1.5) //returns true
 is-float(1)   //returns false
 is-float(1em) //returns false

Requires

is-integer

Since 1.0.0 - undefined
@function is-integer($var) { ... }
View source

Description

Tests whether $var is integer.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for integer type

Literal none

Returns

Bool

Example

 is-integer(1)   //returns true
 is-integer(-50) //returns true
 is-integer(1.5) //returns false
 is-integer(1em) //returns false

Requires

Used by

is-list

Since 1.0.0 - undefined
@function is-list($var) { ... }
View source

Description

Tests whether $var is list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for list type

Literal none

Returns

Bool

Example

 is-list(a b)          //returns true
 is-list(1 2 3)        //returns true
 is-list((test, test)) //returns true
 is-list(test)         //returns false
 is-list(1)            //returns false

Used by

is-measure

Since 1.0.0 - undefined
@function is-measure($var) { ... }
View source

Description

Tests whether $var is measure.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for measure type

Literal none

Returns

Bool

Example

 is-measure(1px)   //returns true
 is-measure(5em)   //returns true
 is-measure(5)     //returns false
 is-measure(test)  //returns false
 is-measure(em)    //returns false

Used by

is-negative

Since 1.0.0 - undefined
@function is-negative($var) { ... }
View source

Description

Tests whether $var is negative.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check whether $var is negative

Literal none

Returns

Bool

Example

 is-negative(-1)   //returns true
 is-negative(0)   //returns true
 is-negative(1)   //returns false

Requires

is-null

Since 1.0.0 - undefined
@function is-null($var) { ... }
View source

Description

Tests whether $var is bool.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for bool type

Literal none

Returns

Bool

Example

 is-null(null)  //returns true
 is-null(false) //returns false
 is-null(0) //returns false

Used by

is-number

Since 1.0.0 - undefined
@function is-number($var) { ... }
View source

Description

Tests whether $var is number.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for numeric type

Literal none

Returns

Bool

Example

 is-number(1)   //returns true
 is-number('1') //returns false
 is-number(1em) //returns false

Used by

is-numeric

Since 1.0.0 - undefined
@function is-numeric($var) { ... }
View source

Description

Tests whether $var is numeric.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for numeric type

Literal none

Returns

Bool

Example

 is-numeric(1)   //returns true
 is-numeric('1') //returns true
 is-numeric(1em) //returns false
 is-numeric(test) //returns false

Used by

is-positive

Since 1.0.0 - undefined
@function is-positive($var) { ... }
View source

Description

Tests whether $var is positive.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check whether $var is positive

Literal none

Returns

Bool

Example

 is-positive(1)   //returns true
 is-positive(0)   //returns true
 is-positive(-1)   //returns false

Requires

is-string

Since 1.0.0 - undefined
@function is-string($var) { ... }
View source

Description

Tests whether $var is string.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

check for string type

Literal none

Returns

Bool

Example

 is-string(test) //returns true
 is-string(1)    //returns false

Used by

is-unit

Since 1.0.0 - undefined
@function is-unit($value) { ... }
View source

Description

Tests whether $var is unit.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

string or list to test

Literal none

Returns

Bool

Example

 is-unit(em) //returns true
 is-unit(1em) //returns false

Requires

Used by

validate

Since 1.0.0 - undefined
@function validate($var, $validations) { ... }
View source

Description

validates input against various tests

Parameters

parameter Name parameter Description parameter Type parameter Default value
$var

a variable to be tested

Literal none
$validations

the validations to test (e.g. measure, string, number, unit). "any" means it can be any type so there won't be any kind of test.

List, String, 'any' none

Returns

Bool

Example

 validate(1em, measure)     //returns 1em
 validate(em, unit string)  //returns em
 validate(1, number string) //returns 1
 validate(1, number)        //returns 1
 validate(1, string)        //returns false

Throws

  • '$var is not a known validation type.'

Requires

Used by

conversion

functions

to-bool

Since 1.0.0 - undefined
@function to-bool($value) { ... }
View source

Description

Convert to bool

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value to cast

Literal none

Returns

Bool

Example

to-bool(1) //true
to-bool(true) //true
to-bool(test) //true
to-bool(0) //false
to-bool(null) //false
to-bool(false) //false

Requires

to-color

Since 1.0.0 - undefined
@function to-color($value) { ... }
View source

Description

Convert to color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value to cast

Literal none

Returns

Color, False

Example

 to-color(#000) //black
 to-color(rgb(0,0,0)) //black
 to-color(null) //false
 to-color(test) //false

Requires

to-list

Since 1.0.0 - undefined
@function to-list($value) { ... }
View source

Description

Convert to list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value to cast

Literal none

Returns

List

Example

 to-list(string) //returns string (type is list)
 to-list(1) //returns 1 (type is list)

Requires

to-map

Since 1.0.0 - undefined
@function to-map($value) { ... }
View source

Description

Convert to map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value to cast

Literal none

Returns

Map

Requires

to-null

Since 1.0.0 - undefined
@function to-null($value) { ... }
View source

Description

Convert to null

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value to cast

Any none

Returns

Null

Requires

to-number

Since 1.0.0 - undefined
@function to-number($value) { ... }
View source

Description

Convert to number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value to cast

Any none

Returns

Number

Requires

to-string

Since 1.0.0 - undefined
@function to-string($value) { ... }
View source

Description

Convert to string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value to cast

Any none

Returns

String

Requires

lists

functions

list-chunk

Since 1.0.0 - undefined
@function list-chunk($list, $size) { ... }
View source

Description

Chunks $list into $size large lists.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to chunk

List none
$size

length of lists

Number none

Returns

List, False

Requires

list-contains

Since 1.0.0 - undefined
@function list-contains($list, $value) { ... }
View source

Description

Returns whether $list contains $value.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to check

List none
$value

value to look for

Any none

Returns

Bool

Requires

list-count-values

Since 1.0.0 - undefined
@function list-count-values($list) { ... }
View source

Description

Counts the number of occurrences of each value of $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to count values from

List none

Returns

Number, False

Requires

list-every

Since 1.0.0 - undefined
@function list-every($list, $function, $args) { ... }
View source

Description

Tests whether all items from $list pass the test implemented by $function.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to run test against

List none
$function

function to run against every item from list

String none
$args

extra arguments to pass to the function

Args none

Returns

Bool, False

Requires

list-filter

Since 1.0.0 - undefined
@function list-filter($list, $index) { ... }
View source

Description

Removes value from $list at index $index.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to remove value from

List none
$index

index to remove

Number none

Returns

List, False

Requires

list-first

Since 1.0.0 - undefined
@function list-first($list) { ... }
View source

Description

Returns first element of $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to retrieve first item from

List none

Returns

Value, False

Requires

list-flatten

Since 1.0.0 - undefined
@function list-flatten($list) { ... }
View source

Description

Turns multidimensional $list into a one-level list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to flatten

List none

Returns

List, False

Requires

list-has-values

Since 1.0.0 - undefined
@function list-has-values($list) { ... }
View source

Description

Tests whether $list is not empty.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to run test against

List none

Returns

Bool

Requires

list-insert

Since 1.0.0 - undefined
@function list-insert($list, $index, $value) { ... }
View source

Description

Adds $value at $index in $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to flatten

List none
$index

index to add

Number none
$value

value to add

Any none

Returns

List, False

Requires

list-intersection

Since 1.0.0 - undefined
@function list-intersection($list, $index) { ... }
View source

Description

Returns a list of shared value from $list and $lists minus duplicates.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to update

List none
$index

other lists

Args none

Returns

List, False

Requires

list-last-index

Since 1.0.0 - undefined
@function list-last-index($list, $value) { ... }
View source

Description

Returns last index of $value in $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to search

List none
$value

value to be searched for

Value none

Returns

Number, False

Requires

list-last

Since 1.0.0 - undefined
@function list-last($list) { ... }
View source

Description

Returns last element of $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to retrieve last value from

List none

Returns

Value

Requires

list-prepend

Since 1.0.0 - undefined
@function list-prepend($list, $value) { ... }
View source

Description

Adds $value as first index of $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to prepend value to

List none
$value

value to prepend to the list

Number none

Returns

List

Requires

list-purge

Since 1.0.0 - undefined
@function list-purge($list) { ... }
View source

Description

Removes all false and null values from $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to purge

List none

Returns

List

Requires

list-random

Since 1.0.0 - undefined
@function list-random($list) { ... }
View source

Description

Returns a random value of $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to receive random value from

List none

Returns

Value

Requires

list-range

Since 1.0.0 - undefined
@function list-range($max) { ... }
View source

Description

Build a list of values from 1 through $max.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$max

maximum value

Number none

Returns

List, Number, Null

Requires

list-remove-duplicates

Since 1.0.0 - undefined
@function list-remove-duplicates($list) { ... }
View source

Description

Removes duplicate values from $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to remove duplicates from

List none

Returns

List

Requires

list-remove

Since 1.0.0 - undefined
@function list-remove($list, $value) { ... }
View source

Description

Removes value(s) $value from $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to update

List none
$value

value to remove

Any none

Returns

List

Requires

list-replace-nth

Since 1.0.0 - undefined
@function list-replace-nth($list, $index, $value) { ... }
View source

Description

Replaces value at $index from $list by $value.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to update

List none
$index

index to update

Number none
$value

new value for index

Value none

Returns

List, False

Requires

list-replace

Since 1.0.0 - undefined
@function list-replace($list, $old, $value) { ... }
View source

Description

Replaces $old by $new in $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to update

List none
$old

value to replace

Value none
$value

new value for $old

Value none

Returns

List

Requires

list-reverse

Since 1.0.0 - undefined
@function list-reverse($list) { ... }
View source

Description

Reverses the order of $list.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to reverse

List none

Returns

List, False

Requires

list-shuffle

Since 1.0.0 - undefined
@function list-shuffle($list) { ... }
View source

Description

Shuffle $list using Fisher-Yates method.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to shuffle

List none

Returns

List, False

Requires

list-slice

Since 1.0.0 - undefined
@function list-slice($list, $start: 1, $end: length($list)) { ... }
View source

Description

Slices $list between $start and $end.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to slice

List none
$start

start index

Number 1
$end

end index

Number length($list)

Returns

List, False

Requires

list-some

Since 1.0.0 - undefined
@function list-some($list, $function, $args) { ... }
View source

Description

Tests whether some items from $list pass the test implemented by $function.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to run test against

List none
$function

function to run against every item from list

String none
$args

extra arguments to pass to the function

Args none

Returns

Bool

Requires

list-sort

Since 1.0.0 - undefined
@function list-sort($list, $order) { ... }
View source

Description

Sorts values of $list using quick-sort algorithm using $order.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to sort

List none
$order

order to respect

List none

Returns

List, False

Requires

list-sum

Since 1.0.0 - undefined
@function list-sum($list, $force: false) { ... }
View source

Description

Sums up all numeric values in $list, stripping unit if $force set to true.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list

List none
$force

enable/disable parseInt

Bool false

Returns

Number, False

Requires

list-tail

Since 1.0.0 - undefined
@function list-tail($list) { ... }
View source

Description

Returns the tail of $list: all items except the first (head).

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to retrieve tail from

List none

Returns

List, False

Requires

list-to-string

Since 1.0.0 - undefined
@function list-to-string($list, $glue: '') { ... }
View source

Description

Joins all elements of $list with $glue

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to cast

List none
$glue

value to use as a join string

String ''

Returns

String, False

Example

list-to-string(a b c) // abc
list-to-string(a b c, '-') // a-b-c

Requires

list-union

Since 1.0.0 - undefined
@function list-union($lists...) { ... }
View source

Description

Returns a list of values from $lists minus duplicates.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$lists

lists to unify

Arglist none

Returns

List, False

Requires

list-walk

Since 1.0.0 - undefined
@function list-walk($list, $function, $args...) { ... }
View source

Description

Apply $function to every item from $list passing $args as parameters.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to update

List none
$function

function to call on each value

String none
$args

optional function arguments

Arglist none

Returns

List, False

Requires

math

functions

math-average

Since 1.0.0 - undefined
@function math-average($values) { ... }
View source

Description

calculates the average of $values

Parameters

parameter Name parameter Description parameter Type parameter Default value
$values

list of numbers and/or measures for calculation

List none

Returns

Number, False

Example

 average(0,10) //returns 5
 average(1,10) //returns 5.5
 average(0px,10px) //returns 5px
 average(0px,10) //returns 5px

Requires

math-clamp

Since 1.0.0 - undefined
@function math-clamp($number, $min, $max) { ... }
View source

Description

checks whether number is between two other values and set it to either maximum or minimum value.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$number

the number to check for

Number none
$min

number that defines the lower range

Number none
$max

number that defines the upper range

Number none

Returns

Number, False

Requires

math-exponent (alias for math-pow)

Since 1.0.0 - undefined
@function math-exponent($base, $exponent) { ... }
View source

Refer to math-pow.

math-precision

Since 1.0.0 - undefined
@function math-precision($float, $digits: 2) { ... }
View source

Description

Fix a list to certain digits

Parameters

parameter Name parameter Description parameter Type parameter Default value
$float

list to chunk

Number none
$digits

length of lists

Number 2

Returns

Number, False

Requires

strings

functions

string-char-at

Since 1.0.0 - undefined
@function string-char-at($string, $index) { ... }
View source

Description

Return character from $string at $index

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to test

String none
$index

index to inspect

String none

Returns

String, False

Example

 string-char-at('test', 1') //returns t

Requires

string-count-words

Since 1.0.0 - undefined
@function string-count-words($string) { ... }
View source

Description

Count number of words in $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to count words in

String none

Returns

String, False

Example

string-count-words('this is a test') //returns 4

Requires

string-count

Since 1.0.0 - undefined
@function string-count($string, $needle) { ... }
View source

Description

Count the number of occurrences of $needle in $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to test

String none
$needle

substring to count in $string

String none

Returns

Number, False

Example

 string-count('just a test', test) //returns 1
 string-count('just a test test', test) //returns 2

Requires

string-ends-with

Since 1.0.0 - undefined
@function string-ends-with($string, $needle) { ... }
View source

Description

Check whether $string ends with $needle

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to test

String none
$needle

substring to check

String none

Returns

Bool

Example

 string-ends-with('just a test', test) //returns true
 string-ends-with('just a test', bla) //returns false

Requires

string-explode

Since 1.0.0 - undefined
@function string-explode($string, $delimiter) { ... }
View source

Description

Split $string into several parts using $delimiter

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to test

String none
$delimiter

string to use as a delimiter to split $string

String none

Returns

List, False

Requires

string-implode

Since 1.0.0 - undefined
@function string-implode($list) { ... }
View source

Description

Implode $list into a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

list to convert to string

$list none

Returns

List, False

Requires

string-last-index

Since 1.0.0 - undefined
@function string-last-index($string, $needle) { ... }
View source

Description

Return last index of $needle in $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to test

String none
$needle

substring to check

String none

Returns

Number, Null, False

Example

 string-last-index(test, t) //returns 4
 string-last-index(test, f) //returns null

Requires

string-lcfirst

Since 1.0.0 - undefined
@function string-lcfirst($string) { ... }
View source

Description

Lower case first character of $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to convert

String none

Returns

String, False

Example

 string-lcfirst(Test) //returns test

Requires

string-pad

Since 1.0.0 - undefined
@function string-pad($string, $length, $pad, $direction) { ... }
View source

Description

Pad $string from $direction with $pad to reach $length characters

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string

String none
$length

number of characters to go for in returned string

Number none
$pad

string to use to pad $string

String none
$direction

direction left or right for padding

String none

Returns

String, False

Example

 string-pad('test', 9, '_', left) //returns _____test
 string-pad('test', 5, '_', left) //returns _test
 string-pad('test', 1, '_', left) //returns test
 string-pad('test', 5, '_', right) //returns test_

Requires

string-printf

Since 1.0.0 - undefined
@function string-printf($string, $elements...) { ... }
View source

Description

Replace occurrences of %s in $string by $elements

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string

String none
$elements

strings to use for replacements in %s

Arglist none

Returns

String, False

Example

 string-printf('this is a %s', 'test') //returns 'this is a test'

Requires

string-repeat

Since 1.0.0 - undefined
@function string-repeat($string, $times) { ... }
View source

Description

Repeat $string $times times

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string

String none
$times

number of times to repeat $string

Number none

Returns

String, False

Example

string-repeat(test, 2) //returns testtest

Requires

string-replace

Since 1.0.0 - undefined
@function string-replace($string, $old, $new, $case) { ... }
View source

Description

Replace $old occurrences by $new in $string respecting $case-sensitive

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string

String none
$old

old substring to replace by $new

String none
$new

new substring to replace $old

String none
$case

sensitive: case-sensitivity

Bool none

Returns

String, False

Example

 string-replace('test this stuff', stuff, thing) //returns 'test this thing'

Requires

string-reverse

Since 1.0.0 - undefined
@function string-reverse($string) { ... }
View source

Description

Reverse $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to reverse

String none

Returns

String, False

Example

string-reverse(test) //returns 'tset'

Requires

string-rotate

Since 1.0.0 - undefined
@function string-rotate($string, $rot) { ... }
View source

Description

Rotate all characters from the alphabet in $string by $rot positions

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to reverse

String none
$rot

number of positions to switch in alphabet

Number none

Returns

String, False

Example

 string-rotate(test) //returns 'grfg'

Requires

string-shuffle

Since 1.0.0 - undefined
@function string-shuffle($string) { ... }
View source

Description

Shuffle characters from $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to shuffle

String none

Returns

String, False

Example

string-shuffle(test) //returns random string, e.g. 'tste'

Requires

string-starts-with

Since 1.0.0 - undefined
@function string-starts-with($string, $needle) { ... }
View source

Description

Check whether $string stars with $needle

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to shuffle

String none
$needle

substring to check

String none

Returns

Bool, False

Example

 string-starts-with(test, te) //returns true
 string-starts-with('a string', 'a str') //returns true
 string-starts-with('a string', 'b') //returns false

Requires

string-trim

Since 1.0.0 - undefined
@function string-trim($string) { ... }
View source

Description

Remove all trailing and leading whitespaces from $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to trim

String none

Returns

String, False

Example

 string-trim('  test') //returns 'test'
 string-trim('  test   ') //returns 'test'
 string-trim('  test is nice   ') //returns 'test is nice'

Requires

string-ucfirst

Since 1.0.0 - undefined
@function string-ucfirst($string) { ... }
View source

Description

Capitalize first letter from $string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

string to convert

String none

Returns

String, False

Example

 string-ucfirst(test) //returns 'Test'

Requires

Ungrouped

units

functions

unit-add

Since 1.0.0 - undefined
@function unit-add($number, $unit) { ... }
View source

Description

adds a unit to a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$number

number to add unit

Number none
$unit

unit that will be applied (e.g. px, em..)

Unit none

Returns

Measure

Requires

Used by

em

Since 1.0.0 - undefined
@function em($px, $base) { ... }
View source

Description

convert px to em

Parameters

parameter Name parameter Description parameter Type parameter Default value
$px

the pixel value that will be converted

Measure, Number none
$base

the base for the calculation of ems

Measure, Number none

Returns

Measure

Requires

px

Since 1.0.0 - undefined
@function px($em, $base) { ... }
View source

Description

convert em or rem to px

Parameters

parameter Name parameter Description parameter Type parameter Default value
$em

the em value that will be converted

Measure, Number none
$base

the base for the calculation of ems

Measure, Number none

Returns

px

Number

Requires

rem

Since 1.0.0 - undefined
@function rem($value, $base: $base-font-size) { ... }
View source

Description

calculates rems out of pixels

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

the pixel value that will be converted, with or without unit

Measure none
$base

the base for the calculation of rems

Number $base-font-size

Returns

Measure

Requires

unit-replace

Since 1.0.0 - undefined
@function unit-replace($value, $unit) { ... }
View source

Description

replaces a unit with another unit

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

value that gets another unit

Measure, Number none
$unit

new unit that will be added

String none

Returns

Measure

Requires

unit-strip

Since 1.0.0 - undefined
@function unit-strip($measure) { ... }
View source

Description

removes all units from a value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$measure

measure to strip unit off

Measure none

Returns

Number

Example

 unit-strip(1em) //returns 1
 unit-strip(10cm) //returns 10
 unit-strip(10) //returns 10
 unit-strip(test) //returns false

Used by

settings

variables

base-font-size

Since 1.0 - undefined
$base-font-size: 16px !default;
View source

Description

Set base font size

Type

Measure

debug

Since 1.0 - undefined
$debug: false !default;
View source

Description

Toggle debug mode

Type

Bool

quiet

Since 1.0 - undefined
$quiet: false !default;
View source

Description

Toggle quiet mode. This is useful for tests.

Type

Bool

legacy

Since 1.0 - undefined
$legacy: false !default;
View source

Description

Toggle support for older browsers

Type

Bool

print

Since 1.0 - undefined
$print: false !default;
View source

Description

Set the type of the stylesheet to "print" to include specific styles.

Type

Bool

prefix

Since 1.0 - undefined
$prefix: false !default;
View source

Description

Set a prefix for classes generated by Vulcan packages

Type

{string, False}