-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmixins-unprefixed.scss
98 lines (88 loc) · 2.28 KB
/
mixins-unprefixed.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@mixin rectangle($width, $height, $color) {
width: $width;
height: $height;
background: $color;
}
@mixin parallelogram($width, $height, $skew, $color) {
@include rectangle($width, $height, $color);
transform: skew($skew);
}
@mixin square($size, $color) {
@include rectangle($size, $size, $color);
}
@mixin circle($size, $color) {
@include square($size, $color);
border-radius: $size / 2;
}
@mixin oval($width, $height, $color) {
width: $width;
height: $height;
border-radius: #{$width} / #{$height};
background: $color;
}
@mixin triangle($direction, $size, $color) {
width: 0;
height: 0;
@if $direction == 'up' {
border-right: $size solid transparent;
border-bottom: $size * 1.732 solid $color;
border-left: $size solid transparent;
} @else if $direction == 'down' {
border-top: $size * 1.732 solid $color;
border-right: $size solid transparent;
border-left: $size solid transparent;
} @else if $direction == 'left' {
border-top: $size solid transparent;
border-right: $size * 1.732 solid $color;
border-bottom: $size solid transparent;
} @else if $direction == 'right' {
border-top: $size solid transparent;
border-bottom: $size solid transparent;
border-left: $size * 1.732 solid $color;
}
}
@mixin corner-triangle($corner, $size, $color) {
width: 0;
height: 0;
@if $corner == 'top-left' {
border-top: $size solid $color;
border-right: $size solid transparent;
} @else if $corner == 'top-right' {
border-top: $size solid $color;
border-left: $size solid transparent;
} @else if $corner == 'bottom-left' {
border-right: $size solid transparent;
border-bottom: $size solid $color;
} @else if $corner == 'bottom-right' {
border-bottom: $size solid $color;
border-left: $size solid transparent;
}
}
@mixin trapezoid($width, $color) {
width: $width;
height: 0;
border-right: $width / 2 solid transparent;
border-bottom: $width solid $color;
border-left: $width / 2 solid transparent;
}
@mixin chevron($direction, $width, $height, $skew, $color) {
position: relative;
width: $width;
height: $height;
&:before, &:after {
position: absolute;
top: 0;
width: 50%;
height: 100%;
background: $color;
content: '';
}
&:before {
left: 0;
transform: skew(0deg, $skew);
}
&:after {
right: 0;
transform: skew(0deg, -$skew);
}
}