@tstdl/base 0.81.28 → 0.81.29
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
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateTailwindPalette = exports.generateTailwindColorsFromThemeColors = exports.generateTailwindColorsFromTheme = void 0;
|
|
4
4
|
const object_1 = require("../utils/object/object");
|
|
5
|
+
const hypenate_1 = require("../utils/string/hypenate");
|
|
6
|
+
const colorTypeSuffixes = ['', '-text', '-background', '-border'];
|
|
5
7
|
function generateTailwindColorsFromTheme(theme) {
|
|
6
8
|
const colors = (0, object_1.objectKeys)(theme.palette);
|
|
7
9
|
return generateTailwindColorsFromThemeColors(colors);
|
|
@@ -9,12 +11,8 @@ function generateTailwindColorsFromTheme(theme) {
|
|
|
9
11
|
exports.generateTailwindColorsFromTheme = generateTailwindColorsFromTheme;
|
|
10
12
|
function generateTailwindColorsFromThemeColors(colors) {
|
|
11
13
|
const entries = colors
|
|
12
|
-
.
|
|
13
|
-
[color
|
|
14
|
-
[`${color}-text`, generateTailwindPalette(color)],
|
|
15
|
-
[`${color}-background`, generateTailwindPalette(color)],
|
|
16
|
-
[`${color}-border`, generateTailwindPalette(color)]
|
|
17
|
-
]);
|
|
14
|
+
.map(hypenate_1.hyphenate)
|
|
15
|
+
.flatMap((color) => colorTypeSuffixes.map((suffix) => [`${color}${suffix}`, generateTailwindPalette(color)]));
|
|
18
16
|
return Object.fromEntries(entries);
|
|
19
17
|
}
|
|
20
18
|
exports.generateTailwindColorsFromThemeColors = generateTailwindColorsFromThemeColors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-adapter.js","sourceRoot":"","sources":["../../source/tailwind/theme-adapter.ts"],"names":[],"mappings":";;;AACA,mDAAmD;
|
|
1
|
+
{"version":3,"file":"theme-adapter.js","sourceRoot":"","sources":["../../source/tailwind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