Destructure Named CSS-in-JS Arguments to use in JavaScript Mixin Functions

InstructorOleg Isonen

Share this video with your friends

Send Tweet

Often times it's hard to remember which order variables have to be used. This is where the concept of named arguments is helpful. The exact same name can then be used inside of a mixin or function.

To name argument in Sass, you need to put a name before the argument, a similar approach can be used with JavaScript functions. In this lesson, you'll see how you can pass in an object and use that objects keys as the named arguments for the function.