@gettrx/core-styles 1.0.68 → 1.1.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/_icons.scss +2 -1
- package/dist/styles/functions/_grid.functions.scss +8 -6
- package/dist/styles/mixins/_border-radius.mixins.scss +5 -3
- package/dist/styles/mixins/_breakpoints.mixins.scss +7 -5
- package/dist/styles/mixins/_grid.mixins.scss +8 -5
- package/dist/styles/mixins/_utilities.mixins.scss +17 -13
- package/dist/styles/utilities/_api.scss +5 -3
- package/dist/styles/utilities/_utilities.scss +9 -8
- package/dist/tokens/_tokens.scss +1 -1
- package/dist/tokens/tokens.css +1 -1
- package/dist/tokens/tokens.js +1 -1
- package/package.json +2 -1
package/dist/styles/_icons.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:string";
|
|
1
2
|
$gtr-icon-font-family: 'Gettrx-Icon' !default;
|
|
2
3
|
$gtr-icon-font-path: '/assets/fonts' !default;
|
|
3
4
|
|
|
@@ -26,7 +27,7 @@ $gtr-icon-font-path: '/assets/fonts' !default;
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
@function unicode($str) {
|
|
29
|
-
@return unquote("\"")+unquote(
|
|
30
|
+
@return string.unquote("\"") + string.unquote(string.insert($str, "\\", 1)) + string.unquote("\"")
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
// Do not edit directly
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:math";
|
|
1
3
|
@function divide($dividend, $divisor, $precision: 10) {
|
|
2
4
|
$sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
|
|
3
|
-
$dividend: abs($dividend);
|
|
4
|
-
$divisor: abs($divisor);
|
|
5
|
+
$dividend: math.abs($dividend);
|
|
6
|
+
$divisor: math.abs($divisor);
|
|
5
7
|
@if $dividend == 0 {
|
|
6
8
|
@return 0;
|
|
7
9
|
}
|
|
@@ -26,16 +28,16 @@
|
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
$result: $result * $factor * $sign;
|
|
29
|
-
$dividend-unit: unit($dividend);
|
|
30
|
-
$divisor-unit: unit($divisor);
|
|
31
|
+
$dividend-unit: math.unit($dividend);
|
|
32
|
+
$divisor-unit: math.unit($divisor);
|
|
31
33
|
$unit-map: (
|
|
32
34
|
"px": 1px,
|
|
33
35
|
"rem": 1rem,
|
|
34
36
|
"em": 1em,
|
|
35
37
|
"%": 1%
|
|
36
38
|
);
|
|
37
|
-
@if ($dividend-unit != $divisor-unit and map
|
|
38
|
-
$result: $result * map
|
|
39
|
+
@if ($dividend-unit != $divisor-unit and map.has-key($unit-map, $dividend-unit)) {
|
|
40
|
+
$result: $result * map.get($unit-map, $dividend-unit);
|
|
39
41
|
}
|
|
40
42
|
@return $result;
|
|
41
43
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:meta";
|
|
1
3
|
// stylelint-disable property-disallowed-list
|
|
2
4
|
// Single side border-radius
|
|
3
5
|
|
|
@@ -5,10 +7,10 @@
|
|
|
5
7
|
@function valid-radius($radius) {
|
|
6
8
|
$return: ();
|
|
7
9
|
@each $value in $radius {
|
|
8
|
-
@if type-of($value) == number {
|
|
9
|
-
$return: append($return, max($value, 0));
|
|
10
|
+
@if meta.type-of($value) == number {
|
|
11
|
+
$return: list.append($return, max($value, 0));
|
|
10
12
|
} @else {
|
|
11
|
-
$return: append($return, $value);
|
|
13
|
+
$return: list.append($return, $value);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
@return $return;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:map";
|
|
1
3
|
@use "../maps/layout.maps" as layout-maps;
|
|
2
4
|
|
|
3
5
|
// Breakpoint viewport sizes and media queries.
|
|
@@ -16,12 +18,12 @@
|
|
|
16
18
|
// md
|
|
17
19
|
// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl xxl))
|
|
18
20
|
// md
|
|
19
|
-
@function breakpoint-next($name, $breakpoints: layout-maps.$grid-breakpoints, $breakpoint-names: map
|
|
20
|
-
$n: index($breakpoint-names, $name);
|
|
21
|
+
@function breakpoint-next($name, $breakpoints: layout-maps.$grid-breakpoints, $breakpoint-names: map.keys($breakpoints)) {
|
|
22
|
+
$n: list.index($breakpoint-names, $name);
|
|
21
23
|
@if not $n {
|
|
22
24
|
@error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
|
|
23
25
|
}
|
|
24
|
-
@return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
|
|
26
|
+
@return if($n < list.length($breakpoint-names), list.nth($breakpoint-names, $n + 1), null);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
// Minimum breakpoint width. Null for the smallest (first) breakpoint.
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px))
|
|
30
32
|
// 576px
|
|
31
33
|
@function breakpoint-min($name, $breakpoints: layout-maps.$grid-breakpoints) {
|
|
32
|
-
$min: map
|
|
34
|
+
$min: map.get($breakpoints, $name);
|
|
33
35
|
@return if($min != 0, $min, null);
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
// >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px))
|
|
44
46
|
// 767.98px
|
|
45
47
|
@function breakpoint-max($name, $breakpoints: layout-maps.$grid-breakpoints) {
|
|
46
|
-
$max: map
|
|
48
|
+
$max: map.get($breakpoints, $name);
|
|
47
49
|
@return if($max and $max > 0, $max - .02, null);
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:math";
|
|
3
|
+
@use "sass:meta";
|
|
1
4
|
@use "../functions/grid.functions" as grid-functions;
|
|
2
5
|
@use "../mixins/breakpoints.mixins" as breakpoints-mixins;
|
|
3
6
|
@use "../maps/layout.maps" as layout-maps;
|
|
@@ -19,7 +22,7 @@
|
|
|
19
22
|
|
|
20
23
|
@mixin make-col-ready() {
|
|
21
24
|
// Add box sizing if only the grid is loaded
|
|
22
|
-
box-sizing: if(variable-exists(include-column-box-sizing), border-box, null);
|
|
25
|
+
box-sizing: if(meta.variable-exists(include-column-box-sizing), border-box, null);
|
|
23
26
|
// Prevent columns from becoming too narrow when at smaller grid tiers by
|
|
24
27
|
// always setting `width: 100%;`. This works because we set the width
|
|
25
28
|
// later on to override this initial width.
|
|
@@ -34,7 +37,7 @@
|
|
|
34
37
|
@mixin make-col($size: false, $columns: tokens.$gtr-content-layout-grid-columns) {
|
|
35
38
|
@if $size {
|
|
36
39
|
flex: 0 0 auto;
|
|
37
|
-
width: percentage(grid-functions.divide($size, $columns));
|
|
40
|
+
width: math.percentage(grid-functions.divide($size, $columns));
|
|
38
41
|
|
|
39
42
|
} @else {
|
|
40
43
|
flex: 1 1 0;
|
|
@@ -49,7 +52,7 @@
|
|
|
49
52
|
|
|
50
53
|
@mixin make-col-offset($size, $columns: tokens.$gtr-content-layout-grid-columns) {
|
|
51
54
|
$num: grid-functions.divide($size, $columns);
|
|
52
|
-
margin-left: if($num == 0, 0, percentage($num));
|
|
55
|
+
margin-left: if($num == 0, 0, math.percentage($num));
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
// Row columns
|
|
@@ -74,7 +77,7 @@
|
|
|
74
77
|
$gutter: tokens.$gtr-size-layout-grid-gutter-width,
|
|
75
78
|
$breakpoints: layout-maps.$grid-breakpoints,
|
|
76
79
|
$row-columns: 6) {
|
|
77
|
-
@each $breakpoint in map
|
|
80
|
+
@each $breakpoint in map.keys($breakpoints) {
|
|
78
81
|
$infix: breakpoints-mixins.breakpoint-infix($breakpoint, $breakpoints);
|
|
79
82
|
|
|
80
83
|
@include breakpoints-mixins.media-breakpoint-up($breakpoint, $breakpoints) {
|
|
@@ -133,7 +136,7 @@
|
|
|
133
136
|
}
|
|
134
137
|
|
|
135
138
|
@mixin make-cssgrid($columns: tokens.$gtr-content-layout-grid-columns, $breakpoints: layout-maps.$grid-breakpoints) {
|
|
136
|
-
@each $breakpoint in map
|
|
139
|
+
@each $breakpoint in map.keys($breakpoints) {
|
|
137
140
|
$infix: breakpoints-mixins.breakpoint-infix($breakpoint, $breakpoints);
|
|
138
141
|
|
|
139
142
|
@include breakpoints-mixins.media-breakpoint-up($breakpoint, $breakpoints) {
|
|
@@ -1,39 +1,43 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
@use "sass:string";
|
|
1
5
|
// Utility generator
|
|
2
6
|
// Used to generate utilities & print utilities
|
|
3
7
|
@mixin generate-utility($utility, $infix: "") {
|
|
4
|
-
$values: map
|
|
8
|
+
$values: map.get($utility, values);
|
|
5
9
|
|
|
6
10
|
// If the values are a list or string, convert it into a map
|
|
7
|
-
@if type-of($values) == "string" or type-of(nth($values, 1)) != "list" {
|
|
8
|
-
$values: zip($values, $values);
|
|
11
|
+
@if meta.type-of($values) == "string" or meta.type-of(list.nth($values, 1)) != "list" {
|
|
12
|
+
$values: list.zip($values, $values);
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
@each $key, $value in $values {
|
|
12
|
-
$properties: map
|
|
16
|
+
$properties: map.get($utility, property);
|
|
13
17
|
|
|
14
18
|
// Multiple properties are possible, for example with vertical or horizontal margins or paddings
|
|
15
|
-
@if type-of($properties) == "string" {
|
|
16
|
-
$properties: append((), $properties);
|
|
19
|
+
@if meta.type-of($properties) == "string" {
|
|
20
|
+
$properties: list.append((), $properties);
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
// Use custom class if present
|
|
20
|
-
$property-class: if(map
|
|
24
|
+
$property-class: if(map.has-key($utility, class), map.get($utility, class), list.nth($properties, 1));
|
|
21
25
|
$property-class: if($property-class == null, "", $property-class);
|
|
22
26
|
|
|
23
27
|
// Use custom CSS variable name if present, otherwise default to `class`
|
|
24
|
-
$css-variable-name: if(map
|
|
28
|
+
$css-variable-name: if(map.has-key($utility, css-variable-name), map.get($utility, css-variable-name), map.get($utility, class));
|
|
25
29
|
|
|
26
30
|
// State params to generate pseudo-classes
|
|
27
|
-
$state: if(map
|
|
31
|
+
$state: if(map.has-key($utility, state), map.get($utility, state), ());
|
|
28
32
|
|
|
29
|
-
$infix: if($property-class == "" and
|
|
33
|
+
$infix: if($property-class == "" and string.slice($infix, 1, 1) == "-", string.slice($infix, 2), $infix);
|
|
30
34
|
|
|
31
35
|
// Don't prefix if value key is null (e.g. with shadow class)
|
|
32
36
|
$property-class-modifier: if($key, if($property-class == "" and $infix == "", "", "-") + $key, "");
|
|
33
37
|
|
|
34
|
-
$is-css-var: map
|
|
35
|
-
$is-local-vars: map
|
|
36
|
-
$is-rtl: map
|
|
38
|
+
$is-css-var: map.get($utility, css-var);
|
|
39
|
+
$is-local-vars: map.get($utility, local-vars);
|
|
40
|
+
$is-rtl: map.get($utility, rtl);
|
|
37
41
|
|
|
38
42
|
@if $value != null {
|
|
39
43
|
@if $is-rtl == false {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:meta";
|
|
1
3
|
@use "utilities";
|
|
2
4
|
@use "../maps/layout.maps" as layout-maps;
|
|
3
5
|
@use "../mixins/utilities.mixins" as utilities-mixin;
|
|
4
6
|
@use "../mixins/breakpoints.mixins" as breakpoints-mixin;
|
|
5
7
|
|
|
6
8
|
// Loop over each breakpoint
|
|
7
|
-
@each $breakpoint in map
|
|
9
|
+
@each $breakpoint in map.keys(layout-maps.$grid-breakpoints) {
|
|
8
10
|
// Generate media query if needed
|
|
9
11
|
@include breakpoints-mixin.media-breakpoint-up($breakpoint) {
|
|
10
12
|
$infix: breakpoints-mixin.breakpoint-infix($breakpoint, layout-maps.$grid-breakpoints);
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
@each $key, $utility in utilities.$utilities {
|
|
14
16
|
// The utility can be disabled with `false`, thus check if the utility is a map first
|
|
15
17
|
// Only proceed if responsive media queries are enabled or if it's the base media query
|
|
16
|
-
@if type-of($utility) == "map" and (map
|
|
18
|
+
@if meta.type-of($utility) == "map" and (map.get($utility, responsive) or $infix == "") {
|
|
17
19
|
@include utilities-mixin.generate-utility($utility, $infix);
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
@each $key, $utility in utilities.$utilities {
|
|
27
29
|
// The utility can be disabled with `false`, thus check if the utility is a map first
|
|
28
30
|
// Then check if the utility needs print styles
|
|
29
|
-
@if type-of($utility) == "map" and map
|
|
31
|
+
@if meta.type-of($utility) == "map" and map.get($utility, print) == true {
|
|
30
32
|
@include utilities-mixin.generate-utility($utility, "-print");
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@use "../../tokens/tokens";
|
|
2
3
|
@use "../maps/spacing.maps" as spacing-maps;
|
|
3
4
|
@use "../maps/fonts.maps" as fonts-maps;
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
|
|
9
10
|
$utilities: () !default;
|
|
10
11
|
// stylelint-disable-next-line scss/dollar-variable-default
|
|
11
|
-
$utilities: map
|
|
12
|
+
$utilities: map.merge(
|
|
12
13
|
(
|
|
13
14
|
// scss-docs-start utils-vertical-align
|
|
14
15
|
"align": (
|
|
@@ -343,43 +344,43 @@ $utilities: map-merge(
|
|
|
343
344
|
responsive: true,
|
|
344
345
|
property: margin,
|
|
345
346
|
class: m,
|
|
346
|
-
values: map
|
|
347
|
+
values: map.merge(spacing-maps.$spacers, (auto: auto))
|
|
347
348
|
),
|
|
348
349
|
"margin-x": (
|
|
349
350
|
responsive: true,
|
|
350
351
|
property: margin-right margin-left,
|
|
351
352
|
class: mx,
|
|
352
|
-
values: map
|
|
353
|
+
values: map.merge(spacing-maps.$spacers, (auto: auto))
|
|
353
354
|
),
|
|
354
355
|
"margin-y": (
|
|
355
356
|
responsive: true,
|
|
356
357
|
property: margin-top margin-bottom,
|
|
357
358
|
class: my,
|
|
358
|
-
values: map
|
|
359
|
+
values: map.merge(spacing-maps.$spacers, (auto: auto))
|
|
359
360
|
),
|
|
360
361
|
"margin-top": (
|
|
361
362
|
responsive: true,
|
|
362
363
|
property: margin-top,
|
|
363
364
|
class: mt,
|
|
364
|
-
values: map
|
|
365
|
+
values: map.merge(spacing-maps.$spacers, (auto: auto))
|
|
365
366
|
),
|
|
366
367
|
"margin-end": (
|
|
367
368
|
responsive: true,
|
|
368
369
|
property: margin-right,
|
|
369
370
|
class: me,
|
|
370
|
-
values: map
|
|
371
|
+
values: map.merge(spacing-maps.$spacers, (auto: auto))
|
|
371
372
|
),
|
|
372
373
|
"margin-bottom": (
|
|
373
374
|
responsive: true,
|
|
374
375
|
property: margin-bottom,
|
|
375
376
|
class: mb,
|
|
376
|
-
values: map
|
|
377
|
+
values: map.merge(spacing-maps.$spacers, (auto: auto))
|
|
377
378
|
),
|
|
378
379
|
"margin-start": (
|
|
379
380
|
responsive: true,
|
|
380
381
|
property: margin-left,
|
|
381
382
|
class: ms,
|
|
382
|
-
values: map
|
|
383
|
+
values: map.merge(spacing-maps.$spacers, (auto: auto))
|
|
383
384
|
),
|
|
384
385
|
// Padding utilities
|
|
385
386
|
"padding": (
|
package/dist/tokens/_tokens.scss
CHANGED
package/dist/tokens/tokens.css
CHANGED
package/dist/tokens/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gettrx/core-styles",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Gettrx core styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gettrx",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"chokidar-cli": "^3.0.0",
|
|
35
|
+
"sass": "^1.83.4",
|
|
35
36
|
"style-dictionary": "^3.9.2",
|
|
36
37
|
"tinycolor2": "^1.6.0"
|
|
37
38
|
}
|