-
Notifications
You must be signed in to change notification settings - Fork 19
Mixins
Anthony Short edited this page Aug 17, 2010
·
3 revisions
This extension allows you to use basic mixins like those used in Sass. Mixins are groups of properties that can take parameters. They’re like functions for CSS.
First, you define a mixin:
@mixin name
{
color:blue;
}
Then you call it within the CSS:
#id
{
@include name;
}
Which will output:
#id
{
color:blue;
}
Mixins become even more powerful when you add parameters.
@mixin box($bg,$border = #eee)
{
display:block;
border:1px solid $border;
background:$bg;
padding:20px;
}
#error
{
@include box(red,#ff0000);
}
Which returns:
#error
{
display:block;
border:1px solid #ff0000;
background:red;
padding:20px;
}
This extension has no settings.
This extension has no hooks.