SASS – Split Space Delimited List Argument (x y z) into Variables

It was tough to spot this one in the docs:

How do you split an argument containing space delimited items?

The answer is the nth function.

@mixin something($breakpoint) {
$min: nth($breakpoint, 1);
$max: nth($breakpoint, 2);
}
something(0 100px); // $min / $max
Advertisements

One thought on “SASS – Split Space Delimited List Argument (x y z) into Variables

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s