tailwind-to-style 2.2.11 → 2.3.0
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 +20 -23
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1630,34 +1630,37 @@ function generator$2i(configOptions = {}) {
|
|
|
1630
1630
|
|
|
1631
1631
|
const { backgroundColor = {} } = theme;
|
|
1632
1632
|
|
|
1633
|
-
const responsiveCssString = generateCssString(
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1633
|
+
const responsiveCssString = generateCssString(
|
|
1634
|
+
({ getCssByColors, isValidCssColor }) => {
|
|
1635
|
+
const cssString = getCssByColors(
|
|
1636
|
+
backgroundColor,
|
|
1637
|
+
(key, value, rgbValue) => {
|
|
1638
|
+
let rgbPropertyValue = "";
|
|
1639
|
+
if (rgbValue) {
|
|
1640
|
+
rgbPropertyValue = `background-color: rgba(${rgbValue}, var(--bg-opacity));`;
|
|
1641
|
+
}
|
|
1641
1642
|
|
|
1642
|
-
|
|
1643
|
-
|
|
1643
|
+
if (value === "custom_value") {
|
|
1644
|
+
return `
|
|
1644
1645
|
${prefix}-${key} {
|
|
1645
|
-
${
|
|
1646
|
+
${
|
|
1647
|
+
isValidCssColor(value) ? "background-color" : "background"
|
|
1648
|
+
}: ${value};
|
|
1646
1649
|
}
|
|
1647
1650
|
`;
|
|
1648
|
-
|
|
1651
|
+
}
|
|
1649
1652
|
|
|
1650
|
-
|
|
1653
|
+
return `
|
|
1651
1654
|
${prefix}-${key} {
|
|
1652
1655
|
--bg-opacity: 1;
|
|
1653
1656
|
background-color: ${value};
|
|
1654
1657
|
${rgbPropertyValue}
|
|
1655
1658
|
}
|
|
1656
1659
|
`;
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
return cssString;
|
|
1663
|
+
});
|
|
1661
1664
|
|
|
1662
1665
|
return responsiveCssString;
|
|
1663
1666
|
}
|
|
@@ -6319,11 +6322,5 @@ function twsx(obj) {
|
|
|
6319
6322
|
return cssString.trim();
|
|
6320
6323
|
}
|
|
6321
6324
|
|
|
6322
|
-
const tailwindCss = {
|
|
6323
|
-
raw: twString,
|
|
6324
|
-
object: cssObject,
|
|
6325
|
-
};
|
|
6326
|
-
|
|
6327
|
-
exports.tailwindCss = tailwindCss;
|
|
6328
6325
|
exports.tws = tws;
|
|
6329
6326
|
exports.twsx = twsx;
|