Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialLuis Chiappe
Courses Plus Student 10,636 PointsInclude Mixin inside Mixin
Can I inside mixin in other mixin? I have a mixin for radius and a mixin for prefixr and I need use de prefixr mixin first but inside put the radius. Is that posible?
Like:
@include prefixr({ @include radius(), value})
2 Answers
Matt Harris
2,762 PointsHey Luis
You can do something like this...
@mixin a {
mixin goes here
}
@mixin b {
@include a();
other stuff goes here
}
cheers
Matt Harris
2,762 PointsHey Kleo
I would still include the brackets. Some mixins require variables and this would go between the brackets so its a good habit to get into.
For example mixin would be...
@mixin border-radius($radius) {
border-radius: $radius;
}
and then include the mixin...
@include border-radius(10px);
cheers
Kleo Petroff
5,726 PointsKleo Petroff
5,726 PointsHi Matt, I can actually include a mixin without the parentheses. What is the better way of doing it - with or without them?