@transfermarkt/global-styles 1.3.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.3.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.14.0"
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
  }
@@ -104,6 +104,7 @@ $tm-colors: (
104
104
  'paris-daisy': #ffea47,
105
105
  // variations
106
106
  'brown': #1c0e05,
107
+ 'bronze': #bf8970,
107
108
  'fuchsia': #d047d1,
108
109
  'gold': #dcb24e,
109
110
  'goldenrod': #d4c06a,