This website collects cookies to deliver better user experience
Day 15 of #100DaysOfCode!
Day 15 of #100DaysOfCode!
Today's progress
Worked on using @each to iterate through each item in a list or a map.
What I learned
Similar to JavaScript's forEach() method. SASS also has a feature to iterate through each item in a list or map. Making it easier and faster to assign values to a variable.
For instance, let's say we want to create several <div> elements with different background colors. One way we can solve this problem is using @each directive within SASS.
@each allows you to iterate through the keys in a list or map and get their values. This is a useful tool especially when having to assign multiple values to a large set of class names.