@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.
@@ -1,7 +1,10 @@
1
1
  @use "sass:map";
2
2
  @use "sass:math";
3
3
  @function divide($dividend, $divisor, $precision: 10) {
4
- $sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
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
- @return if($n < list.length($breakpoint-names), list.nth($breakpoint-names, $n + 1), null);
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
- @return if($min != 0, $min, null);
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
- @return if($max and $max > 0, $max - .02, null);
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
- @return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
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
- box-sizing: if(meta.variable-exists(include-column-box-sizing), border-box, null);
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
- margin-left: if($num == 0, 0, math.percentage($num));
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: if(map.has-key($utility, class), map.get($utility, class), list.nth($properties, 1));
25
- $property-class: if($property-class == null, "", $property-class);
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: if(map.has-key($utility, css-variable-name), map.get($utility, css-variable-name), map.get($utility, class));
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: if(map.has-key($utility, state), map.get($utility, state), ());
43
+ $state: ();
44
+ @if map.has-key($utility, state) {
45
+ $state: map.get($utility, state);
46
+ }
32
47
 
33
- $infix: if($property-class == "" and string.slice($infix, 1, 1) == "-", string.slice($infix, 2), $infix);
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: if($key, if($property-class == "" and $infix == "", "", "-") + $key, "");
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);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Gettrx Core Styles
3
3
  * Do not edit directly
4
- * Generated on Tue, 27 Oct 2026 21:29:36 GMT
4
+ * Generated on Tue, 17 Nov 2026 13:15:29 GMT
5
5
  */
6
6
 
7
7
  $gtr-color-background-base : var(--gtr-color-background-base);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Gettrx Core Styles
3
3
  * Do not edit directly
4
- * Generated on Tue, 27 Oct 2026 21:29:36 GMT
4
+ * Generated on Tue, 17 Nov 2026 13:15:29 GMT
5
5
  */
6
6
 
7
7
  :root {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Gettrx Core Styles
3
3
  * Do not edit directly
4
- * Generated on Tue, 27 Oct 2026 21:29:36 GMT
4
+ * Generated on Tue, 17 Nov 2026 13:15:29 GMT
5
5
  */
6
6
 
7
7
  export const GtrColorBackgroundBase = 'var(--GtrColorBackgroundBase)';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gettrx/core-styles",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "description": "Gettrx core styles",
5
5
  "keywords": [
6
6
  "gettrx",