@gettrx/core-styles 2.1.2 → 2.2.0
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/dist/styles/functions/_grid.functions.scss +4 -1
- package/dist/styles/mixins/_breakpoints.mixins.scss +16 -4
- package/dist/styles/mixins/_grid.mixins.scss +8 -2
- package/dist/styles/mixins/_utilities.mixins.scss +30 -6
- package/dist/tokens/_tokens.scss +1 -1
- package/dist/tokens/tokens.css +1 -1
- package/dist/tokens/tokens.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
@use "sass:map";
|
|
2
2
|
@use "sass:math";
|
|
3
3
|
@function divide($dividend, $divisor, $precision: 10) {
|
|
4
|
-
$sign:
|
|
4
|
+
$sign: -1;
|
|
5
|
+
@if $dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0 {
|
|
6
|
+
$sign: 1;
|
|
7
|
+
}
|
|
5
8
|
$dividend: math.abs($dividend);
|
|
6
9
|
$divisor: math.abs($divisor);
|
|
7
10
|
@if $dividend == 0 {
|
|
@@ -23,7 +23,10 @@
|
|
|
23
23
|
@if not $n {
|
|
24
24
|
@error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
|
|
25
25
|
}
|
|
26
|
-
@
|
|
26
|
+
@if $n < list.length($breakpoint-names) {
|
|
27
|
+
@return list.nth($breakpoint-names, $n + 1);
|
|
28
|
+
}
|
|
29
|
+
@return null;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
// Minimum breakpoint width. Null for the smallest (first) breakpoint.
|
|
@@ -32,7 +35,10 @@
|
|
|
32
35
|
// 576px
|
|
33
36
|
@function breakpoint-min($name, $breakpoints: layout-maps.$grid-breakpoints) {
|
|
34
37
|
$min: map.get($breakpoints, $name);
|
|
35
|
-
@
|
|
38
|
+
@if $min != 0 {
|
|
39
|
+
@return $min;
|
|
40
|
+
}
|
|
41
|
+
@return null;
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
// Maximum breakpoint width.
|
|
@@ -46,7 +52,10 @@
|
|
|
46
52
|
// 767.98px
|
|
47
53
|
@function breakpoint-max($name, $breakpoints: layout-maps.$grid-breakpoints) {
|
|
48
54
|
$max: map.get($breakpoints, $name);
|
|
49
|
-
@
|
|
55
|
+
@if $max and $max > 0 {
|
|
56
|
+
@return $max - .02;
|
|
57
|
+
}
|
|
58
|
+
@return null;
|
|
50
59
|
}
|
|
51
60
|
|
|
52
61
|
// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
|
|
@@ -57,7 +66,10 @@
|
|
|
57
66
|
// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px))
|
|
58
67
|
// "-sm"
|
|
59
68
|
@function breakpoint-infix($name, $breakpoints: layout-maps.$grid-breakpoints) {
|
|
60
|
-
@
|
|
69
|
+
@if breakpoint-min($name, $breakpoints) == null {
|
|
70
|
+
@return "";
|
|
71
|
+
}
|
|
72
|
+
@return "-#{$name}";
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
@mixin make-col-ready() {
|
|
24
24
|
// Add box sizing if only the grid is loaded
|
|
25
|
-
|
|
25
|
+
@if meta.variable-exists(include-column-box-sizing) {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
26
28
|
// Prevent columns from becoming too narrow when at smaller grid tiers by
|
|
27
29
|
// always setting `width: 100%;`. This works because we set the width
|
|
28
30
|
// later on to override this initial width.
|
|
@@ -52,7 +54,11 @@
|
|
|
52
54
|
|
|
53
55
|
@mixin make-col-offset($size, $columns: tokens.$gtr-content-layout-grid-columns) {
|
|
54
56
|
$num: grid-functions.divide($size, $columns);
|
|
55
|
-
|
|
57
|
+
@if $num == 0 {
|
|
58
|
+
margin-left: 0;
|
|
59
|
+
} @else {
|
|
60
|
+
margin-left: math.percentage($num);
|
|
61
|
+
}
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
// Row columns
|
|
@@ -21,19 +21,43 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Use custom class if present
|
|
24
|
-
$property-class:
|
|
25
|
-
|
|
24
|
+
$property-class: null;
|
|
25
|
+
@if map.has-key($utility, class) {
|
|
26
|
+
$property-class: map.get($utility, class);
|
|
27
|
+
} @else {
|
|
28
|
+
$property-class: list.nth($properties, 1);
|
|
29
|
+
}
|
|
30
|
+
@if $property-class == null {
|
|
31
|
+
$property-class: "";
|
|
32
|
+
}
|
|
26
33
|
|
|
27
34
|
// Use custom CSS variable name if present, otherwise default to `class`
|
|
28
|
-
$css-variable-name:
|
|
35
|
+
$css-variable-name: null;
|
|
36
|
+
@if map.has-key($utility, css-variable-name) {
|
|
37
|
+
$css-variable-name: map.get($utility, css-variable-name);
|
|
38
|
+
} @else {
|
|
39
|
+
$css-variable-name: map.get($utility, class);
|
|
40
|
+
}
|
|
29
41
|
|
|
30
42
|
// State params to generate pseudo-classes
|
|
31
|
-
$state:
|
|
43
|
+
$state: ();
|
|
44
|
+
@if map.has-key($utility, state) {
|
|
45
|
+
$state: map.get($utility, state);
|
|
46
|
+
}
|
|
32
47
|
|
|
33
|
-
|
|
48
|
+
@if $property-class == "" and string.slice($infix, 1, 1) == "-" {
|
|
49
|
+
$infix: string.slice($infix, 2);
|
|
50
|
+
}
|
|
34
51
|
|
|
35
52
|
// Don't prefix if value key is null (e.g. with shadow class)
|
|
36
|
-
$property-class-modifier:
|
|
53
|
+
$property-class-modifier: "";
|
|
54
|
+
@if $key {
|
|
55
|
+
@if $property-class == "" and $infix == "" {
|
|
56
|
+
$property-class-modifier: "" + $key;
|
|
57
|
+
} @else {
|
|
58
|
+
$property-class-modifier: "-" + $key;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
37
61
|
|
|
38
62
|
$is-css-var: map.get($utility, css-var);
|
|
39
63
|
$is-local-vars: map.get($utility, local-vars);
|
package/dist/tokens/_tokens.scss
CHANGED
package/dist/tokens/tokens.css
CHANGED
package/dist/tokens/tokens.js
CHANGED