tailwind-to-style 2.12.4 → 2.12.5
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/index.browser.js +32 -14
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/react.cjs.js +50 -14
- package/dist/react.esm.js +50 -15
- package/package.json +1 -1
package/dist/index.browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tailwind-to-style v2.12.
|
|
2
|
+
* tailwind-to-style v2.12.5
|
|
3
3
|
* Convert tailwind classes to inline style
|
|
4
4
|
*
|
|
5
5
|
* @author Bigetion
|
|
@@ -9688,8 +9688,11 @@ function styled(component) {
|
|
|
9688
9688
|
const variantPrefix = getVariantPrefix(namingOptions);
|
|
9689
9689
|
const sep = namingOptions.separator || styledConfig.separator || "-";
|
|
9690
9690
|
const variantSelector = `&.${variantPrefix}${variantKey}${sep}${variantValue}`;
|
|
9691
|
-
|
|
9692
|
-
|
|
9691
|
+
|
|
9692
|
+
// Handle both string and array of classes
|
|
9693
|
+
const normalizedClasses = Array.isArray(variantClasses) ? variantClasses.join(" ") : variantClasses;
|
|
9694
|
+
if (normalizedClasses && normalizedClasses.trim()) {
|
|
9695
|
+
nestedVariants[variantSelector] = normalizedClasses;
|
|
9693
9696
|
}
|
|
9694
9697
|
});
|
|
9695
9698
|
});
|
|
@@ -9709,16 +9712,22 @@ function styled(component) {
|
|
|
9709
9712
|
return `${variantPrefix}${key}${sep}${value}`;
|
|
9710
9713
|
}).join(".");
|
|
9711
9714
|
const compoundSelector = `&.${conditionClasses}`;
|
|
9712
|
-
|
|
9713
|
-
|
|
9715
|
+
|
|
9716
|
+
// Handle both string and array of classes
|
|
9717
|
+
const normalizedClass = Array.isArray(compoundClass) ? compoundClass.join(" ") : compoundClass;
|
|
9718
|
+
if (normalizedClass && normalizedClass.trim()) {
|
|
9719
|
+
nestedVariants[compoundSelector] = normalizedClass;
|
|
9714
9720
|
}
|
|
9715
9721
|
});
|
|
9716
9722
|
|
|
9717
9723
|
// 3. Build final structure: [base, { nested variants }]
|
|
9718
9724
|
// This matches the twsx() format exactly
|
|
9719
9725
|
const styleArray = [];
|
|
9720
|
-
|
|
9721
|
-
|
|
9726
|
+
|
|
9727
|
+
// Handle both string and array of classes for base
|
|
9728
|
+
const normalizedBase = Array.isArray(base) ? base.join(" ") : base;
|
|
9729
|
+
if (normalizedBase && normalizedBase.trim()) {
|
|
9730
|
+
styleArray.push(normalizedBase);
|
|
9722
9731
|
}
|
|
9723
9732
|
if (Object.keys(nestedVariants).length > 0) {
|
|
9724
9733
|
styleArray.push(nestedVariants);
|
|
@@ -9821,8 +9830,11 @@ function styled(component) {
|
|
|
9821
9830
|
const variantPrefix = getVariantPrefix(namingOptions);
|
|
9822
9831
|
const sep = namingOptions.separator || styledConfig.separator || "-";
|
|
9823
9832
|
const variantSelector = `&.${variantPrefix}${variantKey}${sep}${variantValue}`;
|
|
9824
|
-
|
|
9825
|
-
|
|
9833
|
+
|
|
9834
|
+
// Handle both string and array of classes
|
|
9835
|
+
const normalizedClasses = Array.isArray(variantClasses) ? variantClasses.join(" ") : variantClasses;
|
|
9836
|
+
if (normalizedClasses && normalizedClasses.trim()) {
|
|
9837
|
+
nestedVariants[variantSelector] = normalizedClasses;
|
|
9826
9838
|
}
|
|
9827
9839
|
});
|
|
9828
9840
|
});
|
|
@@ -9830,7 +9842,7 @@ function styled(component) {
|
|
|
9830
9842
|
// Generate compound variant selectors
|
|
9831
9843
|
compoundVariants.forEach(compound => {
|
|
9832
9844
|
const {
|
|
9833
|
-
|
|
9845
|
+
class: compoundClass,
|
|
9834
9846
|
...conditions
|
|
9835
9847
|
} = compound;
|
|
9836
9848
|
|
|
@@ -9858,15 +9870,21 @@ function styled(component) {
|
|
|
9858
9870
|
compoundSelector += `:not(.${negClass})`;
|
|
9859
9871
|
});
|
|
9860
9872
|
}
|
|
9861
|
-
|
|
9862
|
-
|
|
9873
|
+
|
|
9874
|
+
// Handle both string and array of classes
|
|
9875
|
+
const normalizedClass = Array.isArray(compoundClass) ? compoundClass.join(" ") : compoundClass;
|
|
9876
|
+
if (normalizedClass && normalizedClass.trim()) {
|
|
9877
|
+
nestedVariants[compoundSelector] = normalizedClass;
|
|
9863
9878
|
}
|
|
9864
9879
|
});
|
|
9865
9880
|
|
|
9866
9881
|
// Build final nested structure: [base, { nested variants }]
|
|
9867
9882
|
const styleArray = [];
|
|
9868
|
-
|
|
9869
|
-
|
|
9883
|
+
|
|
9884
|
+
// Handle both string and array of classes for base
|
|
9885
|
+
const normalizedBase = Array.isArray(base) ? base.join(" ") : base;
|
|
9886
|
+
if (normalizedBase && normalizedBase.trim()) {
|
|
9887
|
+
styleArray.push(normalizedBase);
|
|
9870
9888
|
}
|
|
9871
9889
|
|
|
9872
9890
|
// Add pseudo-state classes to nested
|
package/dist/index.cjs
CHANGED
package/dist/index.esm.js
CHANGED