@tecsinapse/cortex-core 1.1.1 → 1.1.2-beta.1
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/dist/cjs/index.js +2 -0
- package/dist/cjs/tokens/definitions.js +10 -10
- package/dist/cjs/utils/index.js +14 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/tokens/definitions.js +10 -10
- package/dist/esm/utils/index.js +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var toggle = require('./components/toggle/toggle.js');
|
|
|
20
20
|
var tooltip = require('./components/tooltip/tooltip.js');
|
|
21
21
|
var index = require('./preset/index.js');
|
|
22
22
|
var definitions = require('./tokens/definitions.js');
|
|
23
|
+
var index$1 = require('./utils/index.js');
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
|
|
@@ -70,3 +71,4 @@ exports.fontSize = definitions.fontSize;
|
|
|
70
71
|
exports.spacing = definitions.spacing;
|
|
71
72
|
exports.textColor = definitions.textColor;
|
|
72
73
|
exports.zIndex = definitions.zIndex;
|
|
74
|
+
exports.updateThemeColors = index$1.updateThemeColors;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
const colors = {
|
|
4
4
|
primary: {
|
|
5
|
-
xlight: "#fef9f0",
|
|
6
|
-
light: "#fccb83",
|
|
7
|
-
medium: "#f89907",
|
|
8
|
-
dark: "#ae6b05",
|
|
9
|
-
xdark: "#633d03"
|
|
5
|
+
xlight: "var(--color-primary-xlight, #fef9f0)",
|
|
6
|
+
light: "var(--color-primary-light, #fccb83)",
|
|
7
|
+
medium: "var(--color-primary-medium, #f89907)",
|
|
8
|
+
dark: "var(--color-primary-dark, #ae6b05)",
|
|
9
|
+
xdark: "var(--color-primary-xdark, #633d03)"
|
|
10
10
|
},
|
|
11
11
|
secondary: {
|
|
12
|
-
xlight: "#f8f7f7",
|
|
13
|
-
light: "#c2bfbc",
|
|
14
|
-
medium: "#85807a",
|
|
15
|
-
dark: "#5d5955",
|
|
16
|
-
xdark: "#353231"
|
|
12
|
+
xlight: "var(--color-secondary-xlight, #f8f7f7)",
|
|
13
|
+
light: "var(--color-secondary-light, #c2bfbc)",
|
|
14
|
+
medium: "var(--color-secondary-medium, #85807a)",
|
|
15
|
+
dark: "var(--color-secondary-dark, #5d5955)",
|
|
16
|
+
xdark: "var(--color-secondary-xdark, #353231)"
|
|
17
17
|
},
|
|
18
18
|
info: {
|
|
19
19
|
xlight: "#f0f8fe",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const updateThemeColors = (theme) => {
|
|
4
|
+
const root = document.documentElement;
|
|
5
|
+
Object.entries(theme).forEach(([colorName, colorShades]) => {
|
|
6
|
+
if (!colorShades) return;
|
|
7
|
+
Object.entries(colorShades).forEach(([shade, hexValue]) => {
|
|
8
|
+
if (!hexValue) return;
|
|
9
|
+
root.style.setProperty(`--color-${colorName}-${shade}`, hexValue);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.updateThemeColors = updateThemeColors;
|
package/dist/esm/index.js
CHANGED
|
@@ -18,3 +18,4 @@ export { styleInputElement, styleLabelElement, toggle } from './components/toggl
|
|
|
18
18
|
export { tooltip, tooltipContainer } from './components/tooltip/tooltip.js';
|
|
19
19
|
export { default as preset } from './preset/index.js';
|
|
20
20
|
export { borderColor, borderRadius, borderWidth, boxShadow, colors, fontFamily, fontSize, spacing, textColor, zIndex } from './tokens/definitions.js';
|
|
21
|
+
export { updateThemeColors } from './utils/index.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const colors = {
|
|
2
2
|
primary: {
|
|
3
|
-
xlight: "#fef9f0",
|
|
4
|
-
light: "#fccb83",
|
|
5
|
-
medium: "#f89907",
|
|
6
|
-
dark: "#ae6b05",
|
|
7
|
-
xdark: "#633d03"
|
|
3
|
+
xlight: "var(--color-primary-xlight, #fef9f0)",
|
|
4
|
+
light: "var(--color-primary-light, #fccb83)",
|
|
5
|
+
medium: "var(--color-primary-medium, #f89907)",
|
|
6
|
+
dark: "var(--color-primary-dark, #ae6b05)",
|
|
7
|
+
xdark: "var(--color-primary-xdark, #633d03)"
|
|
8
8
|
},
|
|
9
9
|
secondary: {
|
|
10
|
-
xlight: "#f8f7f7",
|
|
11
|
-
light: "#c2bfbc",
|
|
12
|
-
medium: "#85807a",
|
|
13
|
-
dark: "#5d5955",
|
|
14
|
-
xdark: "#353231"
|
|
10
|
+
xlight: "var(--color-secondary-xlight, #f8f7f7)",
|
|
11
|
+
light: "var(--color-secondary-light, #c2bfbc)",
|
|
12
|
+
medium: "var(--color-secondary-medium, #85807a)",
|
|
13
|
+
dark: "var(--color-secondary-dark, #5d5955)",
|
|
14
|
+
xdark: "var(--color-secondary-xdark, #353231)"
|
|
15
15
|
},
|
|
16
16
|
info: {
|
|
17
17
|
xlight: "#f0f8fe",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const updateThemeColors = (theme) => {
|
|
2
|
+
const root = document.documentElement;
|
|
3
|
+
Object.entries(theme).forEach(([colorName, colorShades]) => {
|
|
4
|
+
if (!colorShades) return;
|
|
5
|
+
Object.entries(colorShades).forEach(([shade, hexValue]) => {
|
|
6
|
+
if (!hexValue) return;
|
|
7
|
+
root.style.setProperty(`--color-${colorName}-${shade}`, hexValue);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { updateThemeColors };
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-core",
|
|
3
|
-
"version": "1.1.1",
|
|
3
|
+
"version": "1.1.2-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Core library for tailwindcss based design",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"tailwindcss": ">=3.3.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "c328efb760744af7a61b66794bbb98ece84d60b9"
|
|
35
35
|
}
|