Go ProSign in
Convert SCSS (Sass) to CSS-in-JS

Convert SCSS (Sass) to CSS-in-JS

Autoplay

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

    Oleg IsonenOleg Isonen
    1:54

    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.

    You must be a Member to view code