gerillass 1.6.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -9
- package/SKILL.md +32 -34
- package/gerillass.json +188 -196
- package/package.json +3 -13
- package/scss/_gerillass.scss +8 -92
- package/scss/library/_adaptive.scss +4 -1
- package/scss/library/_after.scss +5 -2
- package/scss/library/_all-buttons.scss +6 -2
- package/scss/library/_all-text-inputs.scss +6 -2
- package/scss/library/_aspect-ratio.scss +27 -0
- package/scss/library/_background-dots.scss +12 -7
- package/scss/library/_background-image.scss +18 -11
- package/scss/library/_background-stripes.scss +14 -9
- package/scss/library/_before.scss +5 -2
- package/scss/library/_border-radius.scss +19 -15
- package/scss/library/_brand-logo.scss +3 -1
- package/scss/library/_breakpoint.scss +25 -20
- package/scss/library/_breakpointer.scss +4 -1
- package/scss/library/_center.scss +3 -1
- package/scss/library/_columnizer.scss +18 -13
- package/scss/library/_counter.scss +21 -18
- package/scss/library/_escape-to-parent.scss +3 -1
- package/scss/library/_except.scss +12 -8
- package/scss/library/_font-face.scss +17 -12
- package/scss/library/_index.scss +52 -0
- package/scss/library/_linear-gradient.scss +13 -7
- package/scss/library/_loadify.scss +15 -11
- package/scss/library/_only.scss +12 -8
- package/scss/library/_position.scss +10 -6
- package/scss/library/_radial-gradient.scss +15 -9
- package/scss/library/_remove.scss +17 -14
- package/scss/library/_reset-figure.scss +3 -1
- package/scss/library/_scissors.scss +24 -21
- package/scss/library/_smartphone.scss +10 -6
- package/scss/library/_sprite.scss +16 -12
- package/scss/library/_stretched-link.scss +3 -1
- package/scss/library/_tablet.scss +10 -6
- package/scss/library/_text-gradient.scss +13 -7
- package/scss/library/_text-shadow.scss +46 -40
- package/scss/library/_triangle.scss +15 -10
- package/scss/lists/_index.scss +8 -0
- package/scss/maps/_index.scss +8 -0
- package/scss/utilities/_clear-unit.scss +3 -1
- package/scss/utilities/_clear-whitespace.scss +9 -6
- package/scss/utilities/_convert-to-em.scss +5 -2
- package/scss/utilities/_convert-to-number.scss +10 -6
- package/scss/utilities/_fill-nulls.scss +18 -0
- package/scss/utilities/_font-sizer.scss +1 -1
- package/scss/utilities/_font-source.scss +15 -10
- package/scss/utilities/_index.scss +24 -0
- package/scss/utilities/_is-color.scss +8 -5
- package/scss/utilities/_is-gutter.scss +8 -5
- package/scss/utilities/_is-number.scss +4 -2
- package/scss/utilities/_is-time.scss +8 -3
- package/scss/utilities/_map-deep-get.scss +4 -2
- package/scss/utilities/_pixelify.scss +11 -7
- package/scss/utilities/_pseudo-selector.scss +4 -2
- package/scss/utilities/_remify.scss +3 -1
- package/scss/utilities/_shade.scss +10 -0
- package/scss/utilities/_shorthand-property.scss +13 -11
- package/scss/utilities/_tint.scss +10 -0
- package/scss/utilities/_validate-breakpoint.scss +9 -5
- package/scss/utilities/_validate-length.scss +10 -5
- package/scss/utilities/_validate-ratio.scss +27 -15
- package/scss/utilities/_validate-scissors.scss +16 -11
- package/scss/_gerillass-prefix.scss +0 -1586
- package/scss/library/_ratio-box.scss +0 -19
- package/scss/library/_responsive-video.scss +0 -19
- package/scss/utilities/_darken.scss +0 -7
- package/scss/utilities/_lighten.scss +0 -7
- package/scss/utilities/_null.scss +0 -16
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "sass:string";
|
|
6
|
+
|
|
3
7
|
@mixin sprite($params...) {
|
|
4
|
-
@if length($params) == 1 {
|
|
5
|
-
@if type-of(nth($params, 1)) == "string" {
|
|
6
|
-
$str-length:
|
|
7
|
-
$str-end:
|
|
8
|
-
@if index(".png" ".jpg" ".svg", $str-end) {
|
|
9
|
-
$image-url: nth($params, 1);
|
|
8
|
+
@if list.length($params) == 1 {
|
|
9
|
+
@if meta.type-of(list.nth($params, 1)) == "string" {
|
|
10
|
+
$str-length: string.length(list.nth($params, 1));
|
|
11
|
+
$str-end: string.slice(list.nth($params, 1), $str-length - 3);
|
|
12
|
+
@if list.index(".png" ".jpg" ".svg", $str-end) {
|
|
13
|
+
$image-url: list.nth($params, 1);
|
|
10
14
|
display: inline-block;
|
|
11
15
|
background-image: url($image-url);
|
|
12
16
|
background-repeat: no-repeat;
|
|
13
17
|
} @else {
|
|
14
|
-
@error "`#{nth($params, 1)}` is not a valid image path for `sprite`. The path must end in .png, .jpg or .svg.";
|
|
18
|
+
@error "`#{list.nth($params, 1)}` is not a valid image path for `sprite`. The path must end in .png, .jpg or .svg.";
|
|
15
19
|
}
|
|
16
20
|
} @else {
|
|
17
|
-
$position: nth($params, 1);
|
|
21
|
+
$position: list.nth($params, 1);
|
|
18
22
|
background-position: $position;
|
|
19
23
|
}
|
|
20
|
-
} @else if length($params) == 2 {
|
|
21
|
-
$image-url: nth($params, 1);
|
|
22
|
-
$position: nth($params, 2);
|
|
24
|
+
} @else if list.length($params) == 2 {
|
|
25
|
+
$image-url: list.nth($params, 1);
|
|
26
|
+
$position: list.nth($params, 2);
|
|
23
27
|
display: inline-block;
|
|
24
28
|
background-image: url($image-url);
|
|
25
29
|
background-position: $position;
|
|
26
30
|
background-repeat: no-repeat;
|
|
27
31
|
} @else {
|
|
28
|
-
@error "`sprite` takes 1 or 2 arguments; you passed #{length($params)}. Pass an image path, a background position, or both in that order.";
|
|
32
|
+
@error "`sprite` takes 1 or 2 arguments; you passed #{list.length($params)}. Pass an image path, a background position, or both in that order.";
|
|
29
33
|
}
|
|
30
34
|
@content;
|
|
31
35
|
}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "../maps/map-for-tablets" as *;
|
|
5
|
+
@use "../utilities/map-deep-get" as *;
|
|
6
|
+
|
|
3
7
|
@mixin tablet($device, $orientation: null) {
|
|
4
|
-
@if map
|
|
8
|
+
@if map.has-key($map-for-tablets, $device) {
|
|
5
9
|
@if $orientation == portrait or $orientation == null {
|
|
6
10
|
@media only screen
|
|
7
|
-
and (device-width:
|
|
8
|
-
and (device-height:
|
|
11
|
+
and (device-width: mapDeepGet($map-for-tablets, $device, 'width'))
|
|
12
|
+
and (device-height: mapDeepGet($map-for-tablets, $device, 'height'))
|
|
9
13
|
and (orientation: portrait) {
|
|
10
14
|
@content;
|
|
11
15
|
}
|
|
12
16
|
} @else if $orientation == landscape {
|
|
13
17
|
@media only screen
|
|
14
|
-
and (device-width:
|
|
15
|
-
and (device-height:
|
|
18
|
+
and (device-width: mapDeepGet($map-for-tablets, $device, 'height'))
|
|
19
|
+
and (device-height: mapDeepGet($map-for-tablets, $device, 'width'))
|
|
16
20
|
and (orientation: landscape) {
|
|
17
21
|
@content;
|
|
18
22
|
}
|
|
@@ -20,6 +24,6 @@
|
|
|
20
24
|
@error "`#{$orientation}` is not a valid $orientation for `tablet`. Pass `portrait`, `landscape`, or no orientation at all.";
|
|
21
25
|
}
|
|
22
26
|
} @else {
|
|
23
|
-
@error "`#{$device}` is not a device known to `tablet`. Pass one of: #{map
|
|
27
|
+
@error "`#{$device}` is not a device known to `tablet`. Pass one of: #{map.keys($map-for-tablets)}.";
|
|
24
28
|
}
|
|
25
29
|
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
@use "sass:meta";
|
|
7
|
+
@use "../maps/map-for-directions" as *;
|
|
8
|
+
|
|
3
9
|
@mixin text-gradient($direction, $colors) {
|
|
4
10
|
$list: ();
|
|
5
|
-
@for $i from 1 through length($colors) {
|
|
6
|
-
$list: append($list, nth($colors, $i), comma);
|
|
11
|
+
@for $i from 1 through list.length($colors) {
|
|
12
|
+
$list: list.append($list, list.nth($colors, $i), comma);
|
|
7
13
|
}
|
|
8
|
-
@if map
|
|
14
|
+
@if map.has-key($map-for-directions, $direction) {
|
|
9
15
|
background: linear-gradient(
|
|
10
|
-
map
|
|
16
|
+
map.get($map-for-directions, $direction),
|
|
11
17
|
$list
|
|
12
18
|
);
|
|
13
|
-
} @else if not map
|
|
14
|
-
@if type-of($direction) != "number" or not index("deg", unit($direction)) {
|
|
15
|
-
@error "`#{$direction}` is not a valid $direction for `text-gradient`. Pass an angle such as `45deg`, or one of: #{map
|
|
19
|
+
} @else if not map.has-key($map-for-directions, $direction) {
|
|
20
|
+
@if meta.type-of($direction) != "number" or not list.index("deg", math.unit($direction)) {
|
|
21
|
+
@error "`#{$direction}` is not a valid $direction for `text-gradient`. Pass an angle such as `45deg`, or one of: #{map.keys($map-for-directions)}.";
|
|
16
22
|
} @else {
|
|
17
23
|
background: linear-gradient($direction, $list);
|
|
18
24
|
}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:color";
|
|
4
|
+
@use "sass:list";
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
@use "sass:meta";
|
|
7
|
+
@use "../utilities/clear-unit" as *;
|
|
8
|
+
|
|
3
9
|
@mixin text-shadow($params...) {
|
|
4
10
|
$value: ();
|
|
5
11
|
|
|
6
|
-
@for $i from 1 through length($params) {
|
|
12
|
+
@for $i from 1 through list.length($params) {
|
|
7
13
|
// Takes each items come from $params.
|
|
8
|
-
$item: nth($params, $i);
|
|
14
|
+
$item: list.nth($params, $i);
|
|
9
15
|
|
|
10
16
|
// Each group must carry at least a direction, a colour and a size. Without
|
|
11
|
-
// this the nth() calls below fail with "Invalid index", which says nothing
|
|
17
|
+
// this the list.nth() calls below fail with "Invalid index", which says nothing
|
|
12
18
|
// about what the mixin wanted.
|
|
13
|
-
@if length($item) < 3 {
|
|
19
|
+
@if list.length($item) < 3 {
|
|
14
20
|
@error "`#{$item}` is not a valid shadow for `text-shadow`. Each group needs a direction, a colour and a size, such as `bottom-right red 5px`. An optional blur and a fill flag may follow.";
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
// The first value comes from the $item is direction.
|
|
18
24
|
// This will be used in the @if, @else statements with $size to control the offset of the shadows.
|
|
19
|
-
$direction: nth($item, 1);
|
|
25
|
+
$direction: list.nth($item, 1);
|
|
20
26
|
|
|
21
27
|
// Second value is the color.
|
|
22
|
-
$color: nth($item, 2);
|
|
28
|
+
$color: list.nth($item, 2);
|
|
23
29
|
|
|
24
30
|
// The third value is the actual offset value of the shadows.
|
|
25
|
-
$size: nth($item, 3);
|
|
31
|
+
$size: list.nth($item, 3);
|
|
26
32
|
|
|
27
33
|
// Takes the unit of the $size value to use it later to increment the amount of shadow based on the unit.
|
|
28
|
-
$sizeUnit: unit($size);
|
|
34
|
+
$sizeUnit: math.unit($size);
|
|
29
35
|
|
|
30
36
|
// The $blur argument is optional. It controls the size of the blur.
|
|
31
37
|
$blur: null;
|
|
@@ -34,104 +40,104 @@
|
|
|
34
40
|
$fill: null;
|
|
35
41
|
|
|
36
42
|
// Assigns the optional sub-arguments to the actual argument.
|
|
37
|
-
@if length($item) == 4 and type-of(nth($item, 4)) == number {
|
|
38
|
-
$blur: nth($item, length($item));
|
|
39
|
-
} @else if length($item) == 4 and type-of(nth($item, 4)) == bool {
|
|
40
|
-
$fill: nth($item, length($item));
|
|
41
|
-
} @else if length($item) == 5 {
|
|
42
|
-
$blur: nth($item, 4);
|
|
43
|
-
$fill: nth($item, length($item));
|
|
43
|
+
@if list.length($item) == 4 and meta.type-of(list.nth($item, 4)) == number {
|
|
44
|
+
$blur: list.nth($item, list.length($item));
|
|
45
|
+
} @else if list.length($item) == 4 and meta.type-of(list.nth($item, 4)) == bool {
|
|
46
|
+
$fill: list.nth($item, list.length($item));
|
|
47
|
+
} @else if list.length($item) == 5 {
|
|
48
|
+
$blur: list.nth($item, 4);
|
|
49
|
+
$fill: list.nth($item, list.length($item));
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
// The code below changes the angle of $direction of the shadow based on the predefined values.
|
|
47
53
|
@if $direction == "top" {
|
|
48
54
|
@if $fill == true {
|
|
49
|
-
// The
|
|
50
|
-
@for $i from 1 through
|
|
55
|
+
// The clearUnit(); function is used here due to it is not possible to count $size with a unit. First, it clears the unit from the $size argument and then adds it back again in the @for loop.
|
|
56
|
+
@for $i from 1 through clearUnit($size) {
|
|
51
57
|
$increase: $i * 1 + $sizeUnit;
|
|
52
58
|
$shadow: 0 -#{$increase} $blur $color;
|
|
53
|
-
$value: append($value, $shadow, comma);
|
|
59
|
+
$value: list.append($value, $shadow, comma);
|
|
54
60
|
}
|
|
55
61
|
} @else {
|
|
56
62
|
$shadow: 0 -#{$size} $blur $color;
|
|
57
|
-
$value: append($value, $shadow, comma);
|
|
63
|
+
$value: list.append($value, $shadow, comma);
|
|
58
64
|
}
|
|
59
65
|
} @else if $direction == "top-left" {
|
|
60
66
|
@if $fill == true {
|
|
61
|
-
@for $i from 1 through
|
|
67
|
+
@for $i from 1 through clearUnit($size) {
|
|
62
68
|
$increase: $i * 1 + $sizeUnit;
|
|
63
69
|
$shadow: -#{$increase} -#{$increase} $blur $color;
|
|
64
|
-
$value: append($value, $shadow, comma);
|
|
70
|
+
$value: list.append($value, $shadow, comma);
|
|
65
71
|
}
|
|
66
72
|
} @else {
|
|
67
73
|
$shadow: -#{$size} -#{$size} $blur $color;
|
|
68
|
-
$value: append($value, $shadow, comma);
|
|
74
|
+
$value: list.append($value, $shadow, comma);
|
|
69
75
|
}
|
|
70
76
|
} @else if $direction == "top-right" {
|
|
71
77
|
@if $fill == true {
|
|
72
|
-
@for $i from 1 through
|
|
78
|
+
@for $i from 1 through clearUnit($size) {
|
|
73
79
|
$increase: $i * 1 + $sizeUnit;
|
|
74
80
|
$shadow: #{$increase} -#{$increase} $blur $color;
|
|
75
|
-
$value: append($value, $shadow, comma);
|
|
81
|
+
$value: list.append($value, $shadow, comma);
|
|
76
82
|
}
|
|
77
83
|
} @else {
|
|
78
84
|
$shadow: #{$size} -#{$size} $blur $color;
|
|
79
|
-
$value: append($value, $shadow, comma);
|
|
85
|
+
$value: list.append($value, $shadow, comma);
|
|
80
86
|
}
|
|
81
87
|
} @else if $direction == "bottom" {
|
|
82
88
|
@if $fill == true {
|
|
83
|
-
@for $i from 1 through
|
|
89
|
+
@for $i from 1 through clearUnit($size) {
|
|
84
90
|
$increase: $i * 1 + $sizeUnit;
|
|
85
91
|
$shadow: 0 #{$increase} $blur $color;
|
|
86
|
-
$value: append($value, $shadow, comma);
|
|
92
|
+
$value: list.append($value, $shadow, comma);
|
|
87
93
|
}
|
|
88
94
|
} @else {
|
|
89
95
|
$shadow: 0 #{$size} $blur $color;
|
|
90
|
-
$value: append($value, $shadow, comma);
|
|
96
|
+
$value: list.append($value, $shadow, comma);
|
|
91
97
|
}
|
|
92
98
|
} @else if $direction == "bottom-left" {
|
|
93
99
|
@if $fill == true {
|
|
94
|
-
@for $i from 1 through
|
|
100
|
+
@for $i from 1 through clearUnit($size) {
|
|
95
101
|
$increase: $i * 1 + $sizeUnit;
|
|
96
102
|
$shadow: -#{$increase} #{$increase} $blur $color;
|
|
97
|
-
$value: append($value, $shadow, comma);
|
|
103
|
+
$value: list.append($value, $shadow, comma);
|
|
98
104
|
}
|
|
99
105
|
} @else {
|
|
100
106
|
$shadow: -#{$size} #{$size} $blur $color;
|
|
101
|
-
$value: append($value, $shadow, comma);
|
|
107
|
+
$value: list.append($value, $shadow, comma);
|
|
102
108
|
}
|
|
103
109
|
} @else if $direction == "bottom-right" {
|
|
104
110
|
@if $fill == true {
|
|
105
|
-
@for $i from 1 through
|
|
111
|
+
@for $i from 1 through clearUnit($size) {
|
|
106
112
|
$increase: $i * 1 + $sizeUnit;
|
|
107
113
|
$shadow: #{$increase} #{$increase} $blur $color;
|
|
108
|
-
$value: append($value, $shadow, comma);
|
|
114
|
+
$value: list.append($value, $shadow, comma);
|
|
109
115
|
}
|
|
110
116
|
} @else {
|
|
111
117
|
$shadow: #{$size} #{$size} $blur $color;
|
|
112
|
-
$value: append($value, $shadow, comma);
|
|
118
|
+
$value: list.append($value, $shadow, comma);
|
|
113
119
|
}
|
|
114
120
|
} @else if $direction == "left" {
|
|
115
121
|
@if $fill == true {
|
|
116
|
-
@for $i from 1 through
|
|
122
|
+
@for $i from 1 through clearUnit($size) {
|
|
117
123
|
$increase: $i * 1 + $sizeUnit;
|
|
118
124
|
$shadow: -#{$increase} 0 $blur $color;
|
|
119
|
-
$value: append($value, $shadow, comma);
|
|
125
|
+
$value: list.append($value, $shadow, comma);
|
|
120
126
|
}
|
|
121
127
|
} @else {
|
|
122
128
|
$shadow: -#{$size} 0 $blur $color;
|
|
123
|
-
$value: append($value, $shadow, comma);
|
|
129
|
+
$value: list.append($value, $shadow, comma);
|
|
124
130
|
}
|
|
125
131
|
} @else if $direction == "right" {
|
|
126
132
|
@if $fill == true {
|
|
127
|
-
@for $i from 1 through
|
|
133
|
+
@for $i from 1 through clearUnit($size) {
|
|
128
134
|
$increase: $i * 1 + $sizeUnit;
|
|
129
135
|
$shadow: #{$increase} 0 $blur $color;
|
|
130
|
-
$value: append($value, $shadow, comma);
|
|
136
|
+
$value: list.append($value, $shadow, comma);
|
|
131
137
|
}
|
|
132
138
|
} @else {
|
|
133
139
|
$shadow: #{$size} 0 $blur $color;
|
|
134
|
-
$value: append($value, $shadow, comma);
|
|
140
|
+
$value: list.append($value, $shadow, comma);
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
@use "../lists/list-of-directions" as *;
|
|
6
|
+
@use "../utilities/is-color" as *;
|
|
7
|
+
|
|
3
8
|
@mixin triangle($direction: "bottom", $color: black, $size: 10px 8px) {
|
|
4
|
-
@if index($list-of-directions, $direction) {
|
|
5
|
-
@if
|
|
9
|
+
@if list.index($list-of-directions, $direction) {
|
|
10
|
+
@if isColor($color){
|
|
6
11
|
content: "";
|
|
7
12
|
height: 0;
|
|
8
13
|
width: 0;
|
|
@@ -10,28 +15,28 @@
|
|
|
10
15
|
border-style: solid;
|
|
11
16
|
@if $direction == "top"{
|
|
12
17
|
border-color: transparent transparent $color;
|
|
13
|
-
border-width: 0 math.div(nth($size, 1), 2) if(length($size) == 2, nth($size, 2), nth($size, 1));
|
|
18
|
+
border-width: 0 math.div(list.nth($size, 1), 2) if(list.length($size) == 2, list.nth($size, 2), list.nth($size, 1));
|
|
14
19
|
} @else if $direction == "top-right" {
|
|
15
20
|
border-color: transparent $color transparent transparent;
|
|
16
|
-
border-width: 0 nth($size, 1) nth($size, 1) 0;
|
|
21
|
+
border-width: 0 list.nth($size, 1) list.nth($size, 1) 0;
|
|
17
22
|
} @else if $direction == "right" {
|
|
18
23
|
border-color: transparent transparent transparent $color;
|
|
19
|
-
border-width: math.div(if(length($size) == 2, nth($size, 2), nth($size, 1)), 2) 0 math.div(if(length($size) == 2, nth($size, 2), nth($size, 1)), 2) nth($size, 1);
|
|
24
|
+
border-width: math.div(if(list.length($size) == 2, list.nth($size, 2), list.nth($size, 1)), 2) 0 math.div(if(list.length($size) == 2, list.nth($size, 2), list.nth($size, 1)), 2) list.nth($size, 1);
|
|
20
25
|
} @else if $direction == "bottom-right" {
|
|
21
26
|
border-color: transparent transparent $color;
|
|
22
|
-
border-width: 0 0 nth($size, 1) nth($size, 1);
|
|
27
|
+
border-width: 0 0 list.nth($size, 1) list.nth($size, 1);
|
|
23
28
|
} @else if $direction == "bottom" {
|
|
24
29
|
border-color: $color transparent transparent;
|
|
25
|
-
border-width: if(length($size) == 2, nth($size, 2), nth($size, 1)) math.div(nth($size, 1), 2) 0;
|
|
30
|
+
border-width: if(list.length($size) == 2, list.nth($size, 2), list.nth($size, 1)) math.div(list.nth($size, 1), 2) 0;
|
|
26
31
|
} @else if $direction == "bottom-left" {
|
|
27
32
|
border-color: transparent transparent transparent $color;
|
|
28
|
-
border-width: nth($size, 1) 0 0 nth($size, 1);
|
|
33
|
+
border-width: list.nth($size, 1) 0 0 list.nth($size, 1);
|
|
29
34
|
} @else if $direction == "left" {
|
|
30
35
|
border-color: transparent $color transparent transparent;
|
|
31
|
-
border-width: math.div(if(length($size) == 2, nth($size, 2), nth($size, 1)), 2) nth($size, 1) math.div(if(length($size) == 2, nth($size, 2), nth($size, 1)), 2) 0;
|
|
36
|
+
border-width: math.div(if(list.length($size) == 2, list.nth($size, 2), list.nth($size, 1)), 2) list.nth($size, 1) math.div(if(list.length($size) == 2, list.nth($size, 2), list.nth($size, 1)), 2) 0;
|
|
32
37
|
} @else if $direction == "top-left" {
|
|
33
38
|
border-color: $color transparent transparent;
|
|
34
|
-
border-width: nth($size, 1) nth($size, 1) 0 0;
|
|
39
|
+
border-width: list.nth($size, 1) list.nth($size, 1) 0 0;
|
|
35
40
|
}
|
|
36
41
|
@content;
|
|
37
42
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
@use "sass:string";
|
|
5
|
+
|
|
6
|
+
@function clearWhitespace($string) {
|
|
7
|
+
@if meta.type-of($string) != "string" {
|
|
8
|
+
@error "`#{$string}` is not a valid $string for `clearWhitespace`. Pass a string.";
|
|
6
9
|
}
|
|
7
|
-
@while (
|
|
8
|
-
$index:
|
|
9
|
-
$string: "#{
|
|
10
|
+
@while (string.index($string, " ") != null) {
|
|
11
|
+
$index: string.index($string, " ");
|
|
12
|
+
$string: "#{string.slice($string, 0, $index - 1)}#{string.slice($string, $index + 1)}";
|
|
10
13
|
}
|
|
11
14
|
@return $string;
|
|
12
15
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:string";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
|
|
6
|
+
@function convertToEm($value) {
|
|
4
7
|
$base-value: 16px;
|
|
5
8
|
$rem-value: math.div($value, $base-value);
|
|
6
|
-
@return $rem-value + unquote("em");
|
|
9
|
+
@return $rem-value + string.unquote("em");
|
|
7
10
|
}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "sass:string";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
@function convertToNumber($value) {
|
|
8
|
+
|
|
9
|
+
@if meta.type-of($value) != "string" {
|
|
10
|
+
@error "`#{$value}` is not a valid $value for `convertToNumber`. Pass a string made only of digits, such as `\"42\"`.";
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
$string-numerals: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
|
|
10
14
|
$calc: 0;
|
|
11
15
|
|
|
12
|
-
@for $i from 1 through
|
|
16
|
+
@for $i from 1 through string.length($value) {
|
|
13
17
|
//Takes every digits in the $value
|
|
14
|
-
$digit:
|
|
18
|
+
$digit: string.slice($value, $i, $i);
|
|
15
19
|
|
|
16
20
|
//Finds the index position of $digit in the $value
|
|
17
|
-
$index-of-digit: index($string-numerals, $digit);
|
|
21
|
+
$index-of-digit: list.index($string-numerals, $digit);
|
|
18
22
|
|
|
19
23
|
// That is because SASS strings are not "0" based but "1", the index position of every digits will be more by one. Here is the simple calculation to find the actual number.
|
|
20
24
|
$actual-digit: $index-of-digit - 1;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
|
|
5
|
+
@function fillNulls($value, $seperation: comma, $skip: false) {
|
|
6
|
+
@if not list.index("comma" "space" "slash", $seperation) {
|
|
7
|
+
@error "`#{$seperation}` is not a valid $seperation for `fillNulls`. Pass `comma`, `space` or `slash`.";
|
|
8
|
+
}
|
|
9
|
+
$list: ();
|
|
10
|
+
@for $i from 1 through list.length($value) {
|
|
11
|
+
@if list.nth($value, $i) == null {
|
|
12
|
+
$list: list.append($list, if($skip, null, 0), $seperation);
|
|
13
|
+
} @else {
|
|
14
|
+
$list: list.append($list, list.nth($value, $i), $seperation);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
@return $list;
|
|
18
|
+
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "../maps/map-for-font-formats" as *;
|
|
6
|
+
@use "../utilities/clear-whitespace" as *;
|
|
7
|
+
|
|
8
|
+
@function fontSource($font-family, $file-path, $file-formats) {
|
|
4
9
|
$list: ();
|
|
5
|
-
@if map
|
|
6
|
-
@if index(eot woff2 woff ttf, $file-formats) {
|
|
7
|
-
$src-value: url('#{$file-path}.#{if(not index(eot, $file-formats), $file-formats, $file-formats+"?#iefix")}')
|
|
8
|
-
#{map
|
|
9
|
-
$list: append($list, $src-value, comma);
|
|
10
|
-
} @else if index(svg, $file-formats) {
|
|
11
|
-
$font-family:
|
|
10
|
+
@if map.has-key($map-for-font-formats, $file-formats) {
|
|
11
|
+
@if list.index(eot woff2 woff ttf, $file-formats) {
|
|
12
|
+
$src-value: url('#{$file-path}.#{if(not list.index(eot, $file-formats), $file-formats, $file-formats+"?#iefix")}')
|
|
13
|
+
#{map.get($map-for-font-formats, $file-formats)};
|
|
14
|
+
$list: list.append($list, $src-value, comma);
|
|
15
|
+
} @else if list.index(svg, $file-formats) {
|
|
16
|
+
$font-family: clearWhitespace($font-family);
|
|
12
17
|
$src-value: url('#{$file-path}.#{$file-formats + "#" + $font-family}')
|
|
13
|
-
#{map
|
|
14
|
-
$list: append($list, $src-value, comma);
|
|
18
|
+
#{map.get($map-for-font-formats, $file-formats)};
|
|
19
|
+
$list: list.append($list, $src-value, comma);
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
22
|
@return $list;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@forward "clear-unit";
|
|
4
|
+
@forward "clear-whitespace";
|
|
5
|
+
@forward "convert-to-em";
|
|
6
|
+
@forward "convert-to-number";
|
|
7
|
+
@forward "fill-nulls";
|
|
8
|
+
@forward "font-sizer";
|
|
9
|
+
@forward "font-source";
|
|
10
|
+
@forward "is-color";
|
|
11
|
+
@forward "is-gutter";
|
|
12
|
+
@forward "is-number";
|
|
13
|
+
@forward "is-time";
|
|
14
|
+
@forward "map-deep-get";
|
|
15
|
+
@forward "pixelify";
|
|
16
|
+
@forward "pseudo-selector";
|
|
17
|
+
@forward "remify";
|
|
18
|
+
@forward "shade";
|
|
19
|
+
@forward "shorthand-property";
|
|
20
|
+
@forward "tint";
|
|
21
|
+
@forward "validate-breakpoint";
|
|
22
|
+
@forward "validate-length";
|
|
23
|
+
@forward "validate-ratio";
|
|
24
|
+
@forward "validate-scissors";
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
|
|
6
|
+
@function isColor($value) {
|
|
4
7
|
$list: ();
|
|
5
|
-
@for $i from 1 through length($value) {
|
|
6
|
-
@if type-of(nth($value, $i)) == "color" {
|
|
7
|
-
$list: append($list, nth($value, $i), comma);
|
|
8
|
+
@for $i from 1 through list.length($value) {
|
|
9
|
+
@if meta.type-of(list.nth($value, $i)) == "color" {
|
|
10
|
+
$list: list.append($list, list.nth($value, $i), comma);
|
|
8
11
|
} @else {
|
|
9
|
-
@error "'#{nth($value, $i)}' is not a color value, please replace it with a valid one.";
|
|
12
|
+
@error "'#{list.nth($value, $i)}' is not a color value, please replace it with a valid one.";
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
@return $list;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
@use "sass:string";
|
|
5
|
+
|
|
3
6
|
// True for anything that can legally sit where a CSS length is expected: a
|
|
4
7
|
// number, a Sass calculation such as calc() or clamp(), or an unquoted string
|
|
5
8
|
// holding a parenthesis, which is how var() and env() arrive.
|
|
6
9
|
//
|
|
7
|
-
// Written because `type-of($value) == number` rejects `var(--gap)`, and a
|
|
10
|
+
// Written because `meta.type-of($value) == number` rejects `var(--gap)`, and a
|
|
8
11
|
// gutter expressed as a custom property is perfectly reasonable CSS.
|
|
9
12
|
|
|
10
|
-
@function
|
|
11
|
-
@if type-of($value) == "number" {
|
|
13
|
+
@function isGutter($value) {
|
|
14
|
+
@if meta.type-of($value) == "number" {
|
|
12
15
|
@return true;
|
|
13
16
|
}
|
|
14
|
-
@if type-of($value) == "calculation" {
|
|
17
|
+
@if meta.type-of($value) == "calculation" {
|
|
15
18
|
@return true;
|
|
16
19
|
}
|
|
17
|
-
@if type-of($value) == "string" and
|
|
20
|
+
@if meta.type-of($value) == "string" and string.index(string.quote($value), "(") {
|
|
18
21
|
@return true;
|
|
19
22
|
}
|
|
20
23
|
@return false;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
|
|
5
|
+
@function isNumber($value) {
|
|
6
|
+
@if meta.type-of($value) == "number" {
|
|
5
7
|
@return $value;
|
|
6
8
|
} @else {
|
|
7
9
|
@warn "Please make sure you pass a valid number!";
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
@use "sass:math";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
|
|
6
|
+
@function isTime($value) {
|
|
7
|
+
@for $i from 1 through list.length($value) {
|
|
8
|
+
@if (meta.type-of($value) == "number" and list.index("ms" "s", math.unit($value)) != null) or $value == 0 {
|
|
4
9
|
@return $value;
|
|
5
10
|
} @else {
|
|
6
11
|
@error "'#{$value}' is not a valid time value. Time values must be specified in either seconds (s) or milliseconds (ms). Please try one of the following forms: '1s', '0.2s', or '3ms'";
|