@transfermarkt/global-styles 1.2.0 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transfermarkt/global-styles",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Shared styles of the Transfermarkt projects",
5
5
  "author": "Transfermarkt",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "test": "echo \"Error: no test specified\" && exit 1"
13
13
  },
14
14
  "volta": {
15
- "node": "20.12.2"
15
+ "node": "20.15.0"
16
16
  },
17
17
  "publishConfig": {
18
18
  "registry": "https://registry.npmjs.org/",
@@ -1,12 +1,25 @@
1
1
  @use 'sass:map';
2
2
  @use '../variables';
3
3
 
4
- @function tm-color($color-name) {
4
+ @function tm-color($color-name, $opacity: 1) {
5
5
  $color-value: map.get(variables.$tm-colors, #{$color-name});
6
6
 
7
7
  @if not $color-value {
8
8
  @error 'Color #{$color-name} does not exist in color map.';
9
9
  }
10
10
 
11
- @return #{$color-value};
11
+ @if $opacity == 1 {
12
+ @return #{$color-value};
13
+ }
14
+
15
+ @if $opacity < 0 or $opacity > 1 {
16
+ @error 'Opacity #{$opacity} must be a decimal value between 0 and 1.';
17
+ }
18
+
19
+ $red: color.red($color-value);
20
+ $green: color.green($color-value);
21
+ $blue: color.blue($color-value);
22
+ $alpha-percentage: $opacity * 100%;
23
+
24
+ @return rgba($red, $green, $blue, $alpha-percentage);
12
25
  }
@@ -89,6 +89,7 @@ $tm-colors: (
89
89
  'venetian-red': #b80718,
90
90
  'peachpuff': #f8cfcd,
91
91
  'light-red': #c03,
92
+ 'utah-crimson-red': #d2003c,
92
93
  'raspberry-ripple': #c8102e,
93
94
  'pure-red': #f00,
94
95
  'pale-chestnut': #e6a8ae,
@@ -103,6 +104,7 @@ $tm-colors: (
103
104
  'paris-daisy': #ffea47,
104
105
  // variations
105
106
  'brown': #1c0e05,
107
+ 'bronze': #bf8970,
106
108
  'fuchsia': #d047d1,
107
109
  'gold': #dcb24e,
108
110
  'goldenrod': #d4c06a,