-
Notifications
You must be signed in to change notification settings - Fork 1
/
mixin_directive.scss
83 lines (58 loc) · 1.16 KB
/
mixin_directive.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Mixin Directives
*/
/* @mixin -------
* Mixins allow you to define styles that
* can be re-used throughout the stylesheet
* without needing to resort to non-semantic classes like .float-left.
*/
@mixin large-text {
font: {
family: Arial;
size: 20px;
weight: bold;
}
color: #ff0000;
}
/* Including a Mixin: @include -----
* Mixins are included in the document with the @include directive.
*/
.page-title {
@include large-text;
padding: 4px;
margin-top: 10px;
}
@mixin silly-links {
a {
color: blue;
background-color: red;
}
}
@include silly-links;
@mixin compound {
@include highlighted-background;
@include header-text;
}
@mixin highlighted-background { background-color: #fc0; }
@mixin header-text { font-size: 20px; }
.test{
@include compound
}
// Arguments
@mixin sexy-border($color, $width) {
border: {
color: $color;
width: $width;
style: dashed;
}
}
p { @include sexy-border(blue, 10px); }
$b:box-shadow;
@mixin box-shadow($shadows...) {
-moz-#{$b}: $shadows;
-webkit-#{$b}: $shadows;
#{$b}: $shadows;
}
.shadows {
@include box-shadow(0px 4px 5px #666, 2px 6px 10px #999);
}