Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested mixins or functions in SASS

Tags:

Some body know how can i use nested mixins or functions in SASS? I have something like this:

@mixin A(){     do something.... }  @mixin B($argu){     @include A(); } 
like image 835
iLevi Avatar asked Apr 15 '13 16:04

iLevi


People also ask

What is difference between mixin and function Sass?

@mixin, very similar to a function but the main difference between the two is that mixins output lines of Sass code that will compile directly into CSS styles, while functions return a value that can then become the value for a CSS property or become something that might be passed to another function or mixin.

What is the use of mixin function in Sass?

What Are Mixins in Sass? To put it simply, a mixin is a code block which allows you to write your styles in it and use it throughout the whole project. You can also think of it as a reusable component.

What are Sass mixins?

Mixins allow you to define styles that can be re-used throughout your stylesheet. They make it easy to avoid using non-semantic classes like . float-left , and to distribute collections of styles in libraries.

What is the difference between mixin and extend in Sass?

@mixin is used to group css code that has to be reused a no of times. Whereas the @extend is used in SASS to inherit(share) the properties from another css selector. @extend is most useful when the elements are almost same or identical. The main difference between the two is in their compiled CSS file.


1 Answers

yeah you already doing it right. You can call first mixin in second one. check this pen http://codepen.io/crazyrohila/pen/mvqHo

like image 142
crazyrohila Avatar answered Oct 28 '22 08:10

crazyrohila