@brady_h/styles 1.0.1 → 1.0.3
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/package.json +7 -2
- package/src/_breakpoints.scss +82 -0
- package/src/_classes.scss +1011 -0
- package/src/_functions.scss +212 -0
- package/src/_mixins.scss +472 -0
- package/src/_variables.scss +407 -0
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brady_h/styles",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Shared SCSS styling foundation for projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"src"
|
|
8
8
|
],
|
|
9
9
|
"sass": "./src/_index.scss",
|
|
10
|
-
"style": "./src/_index.scss"
|
|
10
|
+
"style": "./src/_index.scss",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"release:patch": "npm version patch && npm publish --access public",
|
|
13
|
+
"release:minor": "npm version minor && npm publish --access public",
|
|
14
|
+
"release:major": "npm version major && npm publish --access public"
|
|
15
|
+
}
|
|
11
16
|
}
|
package/src/_breakpoints.scss
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
|
|
4
|
+
$breakpoints: (
|
|
5
|
+
xs: 320px,
|
|
6
|
+
sm: 576px,
|
|
7
|
+
md: 768px,
|
|
8
|
+
lg: 992px,
|
|
9
|
+
xl: 1200px,
|
|
10
|
+
xxl: 1400px,
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
@function breakpoint($name) {
|
|
14
|
+
@if not map.has-key($breakpoints, $name) {
|
|
15
|
+
@error "Unknown breakpoint '#{$name}'. Available breakpoints: #{map.keys($breakpoints)}.";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@return map.get($breakpoints, $name);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@function breakpoint-next($name) {
|
|
22
|
+
$keys: map.keys($breakpoints);
|
|
23
|
+
$index: list.index($keys, $name);
|
|
24
|
+
|
|
25
|
+
@if $index == null {
|
|
26
|
+
@error "Unknown breakpoint '#{$name}'.";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@if $index == list.length($keys) {
|
|
30
|
+
@return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@return map.get($breakpoints, list.nth($keys, $index + 1));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@function breakpoint-previous($name) {
|
|
37
|
+
$keys: map.keys($breakpoints);
|
|
38
|
+
$index: list.index($keys, $name);
|
|
39
|
+
|
|
40
|
+
@if $index == null {
|
|
41
|
+
@error "Unknown breakpoint '#{$name}'.";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@if $index == 1 {
|
|
45
|
+
@return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@return map.get($breakpoints, list.nth($keys, $index - 1));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@function breakpoint-min($name) {
|
|
52
|
+
@return breakpoint($name);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@function breakpoint-max($name) {
|
|
56
|
+
$next: breakpoint-next($name);
|
|
57
|
+
|
|
58
|
+
@if $next == null {
|
|
59
|
+
@return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@return $next - 0.02px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@function breakpoint-between($min, $max) {
|
|
66
|
+
$min-value: breakpoint($min);
|
|
67
|
+
$max-value: breakpoint-max($max);
|
|
68
|
+
|
|
69
|
+
@if $max-value == null {
|
|
70
|
+
@return "(min-width: #{$min-value})";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@if $min-value >= $max-value {
|
|
74
|
+
@error "The minimum breakpoint must be smaller than the maximum breakpoint.";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@return "(min-width: #{$min-value}) and (max-width: #{$max-value})";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@function breakpoint-keys() {
|
|
81
|
+
@return map.keys($breakpoints);
|
|
82
|
+
}
|