Apply Multiple CSS-in-JS Arguments in a JavaScript Mixin Function with the Rest Operator

Share this video with your friends

Send Tweet

The rest operator in JavaScript allows us to 'collect' arguments dynamically in one variable similar to SCSS variable arguments

This is useful for CSS-in-JS when you have CSS properties like box-shadow that can attach multiple shadows to a single element. With the rest operator, you'll be able to add all the shadows you want to a single argument for use in a JavaScript CSS mixin function.