@growth-angels/ds-core 1.6.2 → 1.6.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-angels/ds-core",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Design system by Growth Angels",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -33,7 +33,7 @@
33
33
  "build-storybook": "storybook build"
34
34
  },
35
35
  "dependencies": {
36
- "@growth-angels/foundation": "1.1.1"
36
+ "@growth-angels/foundation": "1.2.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": ">=18"
@@ -24,6 +24,7 @@
24
24
  }
25
25
 
26
26
  @mixin button--link {
27
+ background-color: var(--ga-button-background-link, transparent);
27
28
  color: var(--ga-button-color-link, purple);
28
29
  }
29
30
 
@@ -1,6 +1,10 @@
1
1
  @use "@growth-angels/foundation/config" as *;
2
2
  @use "sass:map";
3
3
 
4
+ $weights: map.get($fonts, "weights");
5
+ $sizes: map.get($fonts, "sizes");
6
+ $responsive-sizes: map.get($fonts, "responsive-sizes");
7
+
4
8
  .ga-ds-text {
5
9
  font-size: var(--font-size, 1.6rem);
6
10
  }
@@ -22,27 +26,42 @@
22
26
  text-align: right;
23
27
  }
24
28
 
25
- $sizes: map.get($fonts, "sizes");
29
+ @function strip-unit($value) {
30
+ @return $value / ($value * 0 + 1);
31
+ }
32
+
33
+ @function clamp-calc($min-size, $max-size) {
34
+ $min-viewport: 375px;
35
+ $max-viewport: 1440px;
36
+
37
+ $min-value: strip-unit($min-size);
38
+ $max-value: strip-unit($max-size);
39
+ $viewport-diff: strip-unit($max-viewport - $min-viewport);
40
+
41
+ $slope: ($max-value - $min-value) / $viewport-diff;
42
+ $intercept: $min-value - ($slope * strip-unit($min-viewport));
43
+
44
+ @return clamp(#{$min-size}, #{$intercept}rem + #{$slope * 100}vw, #{$max-size});
45
+ }
26
46
 
27
47
  @each $size in $sizes {
28
48
  .ga-ds-text--size-#{$size} {
29
- @if $size == 72 {
30
- font-size: calc(11.2rem - clamp(4rem, 2.8732rem + 3.0047vw, calc(#{$size} / 10 * 1rem)));
31
- } @else if $size == 56 {
32
- font-size: calc(9.6rem - clamp(4rem, 3.4366rem + 1.5023vw, calc(#{$size} / 10 * 1rem)));
33
- } @else if $size == 48 {
34
- font-size: calc(8.4rem - clamp(3.6rem, 3.1775rem + 1.1268vw, calc(#{$size} / 10 * 1rem)));
35
- } @else if $size == 40 {
36
- font-size: calc(7.2rem - clamp(3.2rem, 2.9183rem + 0.7512vw, calc(#{$size} / 10 * 1rem)));
37
- } @else if $size == 32 {
38
- font-size: calc(6rem - clamp(2.8rem, 2.6592rem + 0.3756vw, calc(#{$size} / 10 * 1rem)));
49
+ @if map.has-key($responsive-sizes, $size) {
50
+ $config: map.get($responsive-sizes, $size);
51
+ $min: map.get($config, "min");
52
+ $max: map.get($config, "max");
53
+
54
+ @if $min == $max {
55
+ font-size: $min;
56
+ } @else {
57
+ font-size: clamp-calc($min, $max);
58
+ }
39
59
  } @else {
40
60
  font-size: calc(#{$size} / 10 * 1rem);
41
61
  }
42
62
  }
43
63
  }
44
64
 
45
- $weights: map.get($fonts, "weights");
46
65
  @each $weight in $weights {
47
66
  .ga-ds-text--weight-#{$weight} {
48
67
  font-weight: #{$weight};