Tip:
Highlight text to annotate it
X
What's Going on everybody! Welcome to yet another tutorial on LESS.js
My name is Jack Jenkins
and this is Academy of One. Today is going to be a vary
Lime day, I'm wearing a lime shirt and the backgrounds
lime. Alright, I know that was a very
lime joke, why am I
Still doing this, In this lecture we're going to be talking about mixins
Then we are going to be talking about parametric mixins, there's a difference.
And then lastly we're going to be talking about @arguments
and others. [Music]
[Music]. An easy to say what
mixins are is mixins are are variables for the whole declaration
block. For instance, lets say we have this dot
padding. Which has our padding-left and padding-
top values. Then we can use it
Just like we would a variable, and it will output everything.
You gotta love mixins. Mixins have the same scope
as variables do, so if you declare a mixins within
a selector, then that will only work within that selector
Declaration block. If you declare outside of it
Such as in this case, it will work for both of them, or as many
as you want. [Music]
[Music]. Mixins can accept parameters
all you have to do is add the variable with it. So
in this case the @float will be specified in
this less. So when you use it all you have
to put in the parentheses and what you want it to output.
Very easy. Parameters can also accept default
So all you have to do is just leave it blank
and it will put in the default for you. If you add
it will put that in instead.
[Music]
The @arguments keyword will select
all the arguments you declared it's alot
easier if you're using a short hand property, instead of just
specifying each variable independently. That's it for
todays tutorial, tune in next time when we talk about nesting and
& [Music]
[Music]
[Music]