Skip to content

Commit 2cef63f

Browse files
author
Pickra
committed
Extends
1 parent 9d205e3 commit 2cef63f

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

scss/extends/_extends.scss

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
%hero .stuff { background: linear-gradient(red, white, blue); }
2+
%villain { background: darkred; }
3+
4+
@mixin character($type: hero) {
5+
height: 20px;
6+
width: 20px;
7+
8+
@extend %#{$type};
9+
10+
@content;
11+
}
12+
13+
.doc-ock {
14+
@include character(villain){
15+
border: 1px solid green;
16+
};
17+
}
18+
.cheetah { @include character(villain); }
19+
.enchantress { @include character(villain); }
20+
21+
.captain-america { @include character; }
22+
.medusa { @include character(hero); }
23+
.she-hulk { @include character(hero); }
24+
25+
@mixin make-transitions($transitions...) {
26+
transition: $transitions;
27+
}
28+
29+
@media screen and (min-width: 800px) {
30+
%buddy { color: purple; }
31+
}
32+
33+
@media screen and (min-width: 800px) {
34+
.buddy {
35+
@extend %buddy;
36+
}
37+
}

scss/main.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import "extends/extends";
1+
@import "extends/extends";

0 commit comments

Comments
 (0)