@newlogic-digital/core 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +18 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -17,8 +17,25 @@ import {
17
17
 
18
18
  const defineConfig = (config) => new Core().init(config);
19
19
 
20
+ const tailwindColors = (colors = []) => {
21
+ colors.forEach(name => {
22
+ colors[name] = ({opacityVariable, opacityValue}) => {
23
+ if (opacityValue !== undefined) {
24
+ return `rgba(var(--color-${name}), ${opacityValue})`
25
+ }
26
+ if (opacityVariable !== undefined) {
27
+ return `rgba(var(--color-${name}), var(${opacityVariable}, 1))`
28
+ }
29
+ return `rgb(var(--color-${name}))`
30
+ }
31
+ })
32
+
33
+ return colors
34
+ }
35
+
20
36
  export {
21
37
  defineConfig,
38
+ tailwindColors,
22
39
  Core,
23
40
  Utils,
24
41
  Styles,
@@ -33,4 +50,4 @@ export {
33
50
  Package,
34
51
  Config,
35
52
  root
36
- }
53
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@newlogic-digital/core",
3
3
  "type": "module",
4
- "version": "0.7.4",
4
+ "version": "0.7.5",
5
5
  "main": "index.js",
6
6
  "author": "New Logic Studio s.r.o.",
7
7
  "description": "Set of tools that can be used to create modern web applications",