@newlogic-digital/core 0.9.2 → 0.9.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/index.js +2 -1
- package/modules/tailwind/index.cjs +13 -0
- package/modules/tailwind/index.js +13 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -15,7 +15,7 @@ import {
|
|
15
15
|
root
|
16
16
|
} from "./modules/Core.js";
|
17
17
|
|
18
|
-
import { tailwindColors, tailwindColorsRgba, tailwindVariables } from './modules/tailwind/index.js'
|
18
|
+
import { tailwindColors, tailwindColorsRgba, tailwindVariables, tailwindColorsAccent } from './modules/tailwind/index.js'
|
19
19
|
|
20
20
|
const defineConfig = (config) => new Core().init(config);
|
21
21
|
|
@@ -24,6 +24,7 @@ export {
|
|
24
24
|
tailwindColors,
|
25
25
|
tailwindVariables,
|
26
26
|
tailwindColorsRgba,
|
27
|
+
tailwindColorsAccent,
|
27
28
|
Core,
|
28
29
|
Utils,
|
29
30
|
Styles,
|
@@ -31,6 +31,18 @@ const tailwindColorsRgba = (colors = []) => {
|
|
31
31
|
return colors
|
32
32
|
};
|
33
33
|
|
34
|
+
const tailwindColorsAccent = (colors = []) => {
|
35
|
+
const result = {};
|
36
|
+
|
37
|
+
colors.forEach(color => {
|
38
|
+
result[`.accent-color-${color}`] = {
|
39
|
+
'--color-accent': `var(--color-${color})`
|
40
|
+
};
|
41
|
+
});
|
42
|
+
|
43
|
+
return result
|
44
|
+
};
|
45
|
+
|
34
46
|
const tailwindVariables = (type, variables = [], values = {}) => {
|
35
47
|
variables.forEach(name => {
|
36
48
|
values[name] = `var(--${type}-${name})`;
|
@@ -40,5 +52,6 @@ const tailwindVariables = (type, variables = [], values = {}) => {
|
|
40
52
|
};
|
41
53
|
|
42
54
|
exports.tailwindColors = tailwindColors;
|
55
|
+
exports.tailwindColorsAccent = tailwindColorsAccent;
|
43
56
|
exports.tailwindColorsRgba = tailwindColorsRgba;
|
44
57
|
exports.tailwindVariables = tailwindVariables;
|
@@ -27,6 +27,18 @@ const tailwindColorsRgba = (colors = []) => {
|
|
27
27
|
return colors
|
28
28
|
}
|
29
29
|
|
30
|
+
const tailwindColorsAccent = (colors = []) => {
|
31
|
+
const result = {}
|
32
|
+
|
33
|
+
colors.forEach(color => {
|
34
|
+
result[`.accent-color-${color}`] = {
|
35
|
+
'--color-accent': `var(--color-${color})`
|
36
|
+
}
|
37
|
+
})
|
38
|
+
|
39
|
+
return result
|
40
|
+
}
|
41
|
+
|
30
42
|
const tailwindVariables = (type, variables = [], values = {}) => {
|
31
43
|
variables.forEach(name => {
|
32
44
|
values[name] = `var(--${type}-${name})`
|
@@ -35,4 +47,4 @@ const tailwindVariables = (type, variables = [], values = {}) => {
|
|
35
47
|
return values
|
36
48
|
}
|
37
49
|
|
38
|
-
export { tailwindColors, tailwindVariables, tailwindColorsRgba }
|
50
|
+
export { tailwindColors, tailwindVariables, tailwindColorsRgba, tailwindColorsAccent }
|
package/package.json
CHANGED