Join Ray Villalobos for an in-depth discussion in this video Conditional @if statements and argument lists, part of Sass Essential Training.
- Conditional statements allow you to create styles…that react to changes in your CSS.…To show you this, I'm going to modify…our breakpoint mixin to take more than one value.…So, that is in our mixins.scss document.…At the very end,…right now it takes a single argument.…There's a special operator that you can use…to create a mixin that takes up any number of values.…It's called an argument list.…And to create it, you just add three dots to any variable.…
So if I wanted to, I can modify this variable called length…and add three dots at the end of it.…That means that this length variable…is going to accept a series of values.…Now, you don't have to have a single variable like this.…You can actually use a list right here as well,…so you can say something like first…and then maybe length isn't the best word here.…We could say first, and then arguments.…This way, our function or mixin could take in two values,…one value for sure…and then a number of other values after that.…
So, we're going to use this notation to make our break mixin…
- Working with variables
- Nesting styles
- Creating mixins
- Conditional statements and loops in SassScript
- Extending your mixins
- Working with lists and maps
Skill Level Intermediate
CSS: Advanced Typographic Techniqueswith James Williamson3h 14m Intermediate
1. Getting Started
Understanding Sass7m 33s
2. Learning Sass Fundamentals
3. Working with SassScript
Next steps1m 21s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.