@trackunit/css-tailwind 0.0.128 → 0.0.129
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "@trackunit/css-core";
|
|
2
2
|
/**
|
|
3
3
|
* Gets the value of a color from the css custom properties TailwindCSS theme.
|
|
4
|
-
* Looks in `theme.css` and `tailwind-custom-properties.css`.
|
|
5
4
|
*
|
|
6
5
|
* @param {string} customProperty The property name
|
|
7
6
|
* @returns {string} The value of the color "RRR GGG BBB" or "unknown value" if the color is not found.
|
|
@@ -141,10 +141,11 @@ var variablesToCSSRules = variablesDecleration => {
|
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
// libs/css/tailwind-custom-properties-plugin/src/plugin.ts
|
|
144
|
-
var CssTailwindCustomPropertiesPlugin = (0, import_plugin.default)(({ addBase, theme }) => {
|
|
144
|
+
var CssTailwindCustomPropertiesPlugin = (0, import_plugin.default)(({ addBase, addVariant, theme }) => {
|
|
145
145
|
const variablesDeclerationFromThemeConfig = theme("variables", {});
|
|
146
146
|
const cssRules = variablesToCSSRules(variablesDeclerationFromThemeConfig);
|
|
147
147
|
addBase(cssRules);
|
|
148
|
+
addVariant("child", "& > *");
|
|
148
149
|
});
|
|
149
150
|
|
|
150
151
|
// libs/css/component-tokens/src/plugin.ts
|
|
@@ -1264,10 +1265,18 @@ var designTokensToFontSizeTailwindConfig = fontSizes => {
|
|
|
1264
1265
|
return Object.fromEntries(entries);
|
|
1265
1266
|
};
|
|
1266
1267
|
|
|
1268
|
+
// libs/shared/utils/src/typeUtils.ts
|
|
1269
|
+
var objectEntries = object =>
|
|
1270
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion, local-rules/prefer-custom-object-entries
|
|
1271
|
+
Object.entries(object);
|
|
1272
|
+
var objectFromEntries = entries => {
|
|
1273
|
+
return Object.fromEntries(entries);
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1267
1276
|
// libs/css/tailwind/src/lib/utilities/themeColorsToVariableObjectDefinition.ts
|
|
1268
1277
|
function themeColorsToVariableObjectDefinition(themeColors2) {
|
|
1269
|
-
return
|
|
1270
|
-
|
|
1278
|
+
return objectFromEntries(
|
|
1279
|
+
objectEntries(themeColors2).map(([_, value]) => {
|
|
1271
1280
|
return [value.name, value.variants];
|
|
1272
1281
|
})
|
|
1273
1282
|
);
|