FAQ: Mixins and the & Selector - List Arguments

This community-built FAQ covers the “List Arguments” exercise from the lesson “Mixins and the & Selector”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Sass

FAQs on the exercise List Arguments

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

What does the “…” operator in “$stripe-properties…” do?

2 Likes

same question. Can we skip that 3 dots?

1 Like

The same question occurs to me. So I’ve replicated the code on Codepen: https://codepen.io/masakudamatsu/pen/MNppvo

When I remove ..., I get an error message saying “Mixin stripes is missing argument $width-percent.”

$width-percent is the second argument for the stripes mixin.

It seems that without ... the variable $stripe-properties will be interpreted as the first argument for the stripes mixin.

I think I figured it out. The “…” works like the spread operator in JavaScript. It can be used to pass each list element as a different argument to a mixin.

In your codepen, $stripe-properties is a list with 4 elements. If you pass it without “…”, the list will indeed be passed as the first argument. But if you add “…”, you’ll spread its elements: the first element will be passed as the first element; the second element will be passed as the second argument; and so on.

You can check more in this post: https://scotch.io/tutorials/how-to-use-sass-mixins#toc-passing-arguments-to-mixins (see Variable Arguments Continued)

Hope it helps!


I did everything they asked and I got the checkmark and passed the exercise but what? and the stripes do a really strange flicker.

Passed but at what cost?

I seem to have a bug in every single lesson of this course so far… Code it doesn’t want or expect me to have from a previous lesson is being carried over making me not pass the lesson, then when I reset and complete the lesson it still fails me even though comparing the two code bases they’re identical?

Please fix this course.