|
|
@@ -5,11 +5,38 @@
|
|
|
$a: #f00;
|
|
|
$b: 50;
|
|
|
$c: #ff0 !default;
|
|
|
+@mixin sun {
|
|
|
+ width: 200px;
|
|
|
+ height: 300px;
|
|
|
+ margin: 10px;
|
|
|
+ // border-radius: 20px;
|
|
|
+ border: 3px solid #00f;
|
|
|
+ // box-shadow: 30px 20px 4px #f00;
|
|
|
+}
|
|
|
+@mixin rain($x) {
|
|
|
+ border-radius: $x;
|
|
|
+}
|
|
|
|
|
|
+@mixin tea($x:$a) {
|
|
|
+ background:$x;
|
|
|
+}
|
|
|
+@mixin box1($x...) {
|
|
|
+ box-shadow: $x;
|
|
|
+ // box-shadow: $x $q $w $r;
|
|
|
+ // @if length($x) >= 3 {
|
|
|
+ // box-shadow: $x;
|
|
|
+ // } @else {
|
|
|
+ // box-shadow: 30px 20px 4px plum;
|
|
|
+ // }
|
|
|
+}
|
|
|
h1 {
|
|
|
- color: $a !important;
|
|
|
+ // color: $a !important;
|
|
|
font-size: $b + px;
|
|
|
- // color: $vase;
|
|
|
+ color: $vase;
|
|
|
+ @include sun;
|
|
|
+ @include rain(30px);
|
|
|
+ @include tea;
|
|
|
+ @include box1(30px 20px 4px plum)
|
|
|
}
|
|
|
|
|
|
// ul {
|
|
|
@@ -54,7 +81,11 @@ ul {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+/*
|
|
|
+ 混合宏
|
|
|
+ @mixin 允许定义一个可以再整个样式表复制的样式
|
|
|
+ @include 可以将mixin混入到整个样式表中
|
|
|
+*/
|
|
|
p {
|
|
|
color: $d;
|
|
|
}
|