From the course: Sass Essential Training
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
For - Sass Tutorial
From the course: Sass Essential Training
For
- [Instructor] The for at-rule gives you a way to iterate through a series of numbers, which can be pretty useful. Now this can either count up or down through a series of numbers and the format looks like this. You include the for at-rule and then you specify a variable and then you either use the to or through keyword with an expression. Now, you use to if you want it not to include the last number. So if you say like one, two, three, it would just give you one and two but not three and you use the through keyword when you want it to go all the way to the end of the number so include that last number. And then you can use something that evaluates to one expression and then a series of commands in the curly braces. Here's an example of how you can generate all of these sizes for your headlines using the for at-rule. So let's take a look at how this would actually work. So here you can see that I have that same piece ofâ¦
Contents
-
-
-
-
-
(Locked)
Interpolation2m 22s
-
(Locked)
Placeholder selectors1m 29s
-
(Locked)
Comments1m 52s
-
(Locked)
Using lists9m 21s
-
(Locked)
Each2m 47s
-
(Locked)
For2m 1s
-
(Locked)
Maps5m 1s
-
(Locked)
Operators and conditionals5m 57s
-
(Locked)
Color functions4m 27s
-
(Locked)
Challenge: Badges1m 36s
-
(Locked)
Solution: Badges8m 43s
-
(Locked)
-