tailwind-to-style 2.8.6 → 2.8.9

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,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.8.6
2
+ * tailwind-to-style v2.8.9
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
@@ -6793,7 +6793,8 @@ var tailwindToStyle = (function (exports) {
6793
6793
  // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6794
6794
  // Fractions typically have denominators of 2, 3, 4, 5, 6, 12
6795
6795
  const fractionDenominators = [2, 3, 4, 5, 6, 12];
6796
- const couldBeFraction = fractionDenominators.includes(opacityValue) && (className.startsWith('w-') || className.startsWith('h-') || className.startsWith('max-w-') || className.startsWith('max-h-') || className.startsWith('min-w-') || className.startsWith('min-h-'));
6796
+ const fractionPrefixes = ["w-", "h-", "max-w-", "max-h-", "min-w-", "min-h-", "top-", "bottom-", "left-", "right-", "inset-", "inset-x-", "inset-y-", "translate-x-", "translate-y-"];
6797
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => className.startsWith(prefix));
6797
6798
  if (!couldBeFraction) {
6798
6799
  baseClassName = className.replace(/\/\d+$/, "");
6799
6800
  hasOpacityModifier = true;
@@ -6959,9 +6960,10 @@ var tailwindToStyle = (function (exports) {
6959
6960
  const opacityValue = parseInt(opacityMatch[1], 10);
6960
6961
  // If it's a valid opacity value (0-100), treat it as opacity modifier
6961
6962
  if (opacityValue >= 0 && opacityValue <= 100) {
6962
- // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6963
+ // Check if this could be a fraction (e.g., w-2/3, h-1/2, top-1/2, etc.)
6963
6964
  const fractionDenominators = [2, 3, 4, 5, 6, 12];
6964
- const couldBeFraction = fractionDenominators.includes(opacityValue) && (pureClassName.startsWith('w-') || pureClassName.startsWith('h-') || pureClassName.startsWith('max-w-') || pureClassName.startsWith('max-h-') || pureClassName.startsWith('min-w-') || pureClassName.startsWith('min-h-'));
6965
+ const fractionPrefixes = ["w-", "h-", "max-w-", "max-h-", "min-w-", "min-h-", "top-", "bottom-", "left-", "right-", "inset-", "inset-x-", "inset-y-", "translate-x-", "translate-y-", "rounded-t-", "rounded-b-", "rounded-l-", "rounded-r-", "rounded-bl-", "rounded-br-", "rounded-tl-", "rounded-tr-", "flex-basis-", "z-"];
6966
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => pureClassName.startsWith(prefix));
6965
6967
  if (!couldBeFraction) {
6966
6968
  baseClassName = pureClassName.replace(/\/\d+$/, "");
6967
6969
  hasOpacityModifier = true;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.8.6
2
+ * tailwind-to-style v2.8.9
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
@@ -6794,7 +6794,8 @@ function tws(classNames, convertToJson) {
6794
6794
  // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6795
6795
  // Fractions typically have denominators of 2, 3, 4, 5, 6, 12
6796
6796
  const fractionDenominators = [2, 3, 4, 5, 6, 12];
6797
- const couldBeFraction = fractionDenominators.includes(opacityValue) && (className.startsWith('w-') || className.startsWith('h-') || className.startsWith('max-w-') || className.startsWith('max-h-') || className.startsWith('min-w-') || className.startsWith('min-h-'));
6797
+ const fractionPrefixes = ["w-", "h-", "max-w-", "max-h-", "min-w-", "min-h-", "top-", "bottom-", "left-", "right-", "inset-", "inset-x-", "inset-y-", "translate-x-", "translate-y-"];
6798
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => className.startsWith(prefix));
6798
6799
  if (!couldBeFraction) {
6799
6800
  baseClassName = className.replace(/\/\d+$/, "");
6800
6801
  hasOpacityModifier = true;
@@ -6960,9 +6961,10 @@ function processClass(cls, selector, styles) {
6960
6961
  const opacityValue = parseInt(opacityMatch[1], 10);
6961
6962
  // If it's a valid opacity value (0-100), treat it as opacity modifier
6962
6963
  if (opacityValue >= 0 && opacityValue <= 100) {
6963
- // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6964
+ // Check if this could be a fraction (e.g., w-2/3, h-1/2, top-1/2, etc.)
6964
6965
  const fractionDenominators = [2, 3, 4, 5, 6, 12];
6965
- const couldBeFraction = fractionDenominators.includes(opacityValue) && (pureClassName.startsWith('w-') || pureClassName.startsWith('h-') || pureClassName.startsWith('max-w-') || pureClassName.startsWith('max-h-') || pureClassName.startsWith('min-w-') || pureClassName.startsWith('min-h-'));
6966
+ const fractionPrefixes = ["w-", "h-", "max-w-", "max-h-", "min-w-", "min-h-", "top-", "bottom-", "left-", "right-", "inset-", "inset-x-", "inset-y-", "translate-x-", "translate-y-", "rounded-t-", "rounded-b-", "rounded-l-", "rounded-r-", "rounded-bl-", "rounded-br-", "rounded-tl-", "rounded-tr-", "flex-basis-", "z-"];
6967
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => pureClassName.startsWith(prefix));
6966
6968
  if (!couldBeFraction) {
6967
6969
  baseClassName = pureClassName.replace(/\/\d+$/, "");
6968
6970
  hasOpacityModifier = true;
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.8.6
2
+ * tailwind-to-style v2.8.9
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
@@ -6790,7 +6790,8 @@ function tws(classNames, convertToJson) {
6790
6790
  // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6791
6791
  // Fractions typically have denominators of 2, 3, 4, 5, 6, 12
6792
6792
  const fractionDenominators = [2, 3, 4, 5, 6, 12];
6793
- const couldBeFraction = fractionDenominators.includes(opacityValue) && (className.startsWith('w-') || className.startsWith('h-') || className.startsWith('max-w-') || className.startsWith('max-h-') || className.startsWith('min-w-') || className.startsWith('min-h-'));
6793
+ const fractionPrefixes = ["w-", "h-", "max-w-", "max-h-", "min-w-", "min-h-", "top-", "bottom-", "left-", "right-", "inset-", "inset-x-", "inset-y-", "translate-x-", "translate-y-"];
6794
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => className.startsWith(prefix));
6794
6795
  if (!couldBeFraction) {
6795
6796
  baseClassName = className.replace(/\/\d+$/, "");
6796
6797
  hasOpacityModifier = true;
@@ -6956,9 +6957,10 @@ function processClass(cls, selector, styles) {
6956
6957
  const opacityValue = parseInt(opacityMatch[1], 10);
6957
6958
  // If it's a valid opacity value (0-100), treat it as opacity modifier
6958
6959
  if (opacityValue >= 0 && opacityValue <= 100) {
6959
- // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6960
+ // Check if this could be a fraction (e.g., w-2/3, h-1/2, top-1/2, etc.)
6960
6961
  const fractionDenominators = [2, 3, 4, 5, 6, 12];
6961
- const couldBeFraction = fractionDenominators.includes(opacityValue) && (pureClassName.startsWith('w-') || pureClassName.startsWith('h-') || pureClassName.startsWith('max-w-') || pureClassName.startsWith('max-h-') || pureClassName.startsWith('min-w-') || pureClassName.startsWith('min-h-'));
6962
+ const fractionPrefixes = ["w-", "h-", "max-w-", "max-h-", "min-w-", "min-h-", "top-", "bottom-", "left-", "right-", "inset-", "inset-x-", "inset-y-", "translate-x-", "translate-y-", "rounded-t-", "rounded-b-", "rounded-l-", "rounded-r-", "rounded-bl-", "rounded-br-", "rounded-tl-", "rounded-tr-", "flex-basis-", "z-"];
6963
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => pureClassName.startsWith(prefix));
6962
6964
  if (!couldBeFraction) {
6963
6965
  baseClassName = pureClassName.replace(/\/\d+$/, "");
6964
6966
  hasOpacityModifier = true;