tailwind-to-style 2.8.9 → 2.8.10

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.9
2
+ * tailwind-to-style v2.8.10
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
@@ -6476,6 +6476,8 @@ var tailwindToStyle = (function (exports) {
6476
6476
  if (!cssObject) {
6477
6477
  cssObject = convertCssToObject(twString);
6478
6478
  }
6479
+ const fractionDenominators = [2, 3, 4, 5, 6, 12];
6480
+ 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-"];
6479
6481
  const breakpoints = {
6480
6482
  sm: "@media (min-width: 640px)",
6481
6483
  md: "@media (min-width: 768px)",
@@ -6792,9 +6794,7 @@ var tailwindToStyle = (function (exports) {
6792
6794
  if (opacityValue >= 0 && opacityValue <= 100) {
6793
6795
  // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6794
6796
  // Fractions typically have denominators of 2, 3, 4, 5, 6, 12
6795
- const fractionDenominators = [2, 3, 4, 5, 6, 12];
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
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => className.startsWith(prefix) || className.startsWith(`-${prefix}`));
6798
6798
  if (!couldBeFraction) {
6799
6799
  baseClassName = className.replace(/\/\d+$/, "");
6800
6800
  hasOpacityModifier = true;
@@ -6961,9 +6961,7 @@ var tailwindToStyle = (function (exports) {
6961
6961
  // If it's a valid opacity value (0-100), treat it as opacity modifier
6962
6962
  if (opacityValue >= 0 && opacityValue <= 100) {
6963
6963
  // Check if this could be a fraction (e.g., w-2/3, h-1/2, top-1/2, etc.)
6964
- const fractionDenominators = [2, 3, 4, 5, 6, 12];
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));
6964
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => pureClassName.startsWith(prefix) || pureClassName.startsWith(`-${prefix}`));
6967
6965
  if (!couldBeFraction) {
6968
6966
  baseClassName = pureClassName.replace(/\/\d+$/, "");
6969
6967
  hasOpacityModifier = true;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.8.9
2
+ * tailwind-to-style v2.8.10
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
@@ -6477,6 +6477,8 @@ if (!twString) {
6477
6477
  if (!cssObject) {
6478
6478
  cssObject = convertCssToObject(twString);
6479
6479
  }
6480
+ const fractionDenominators = [2, 3, 4, 5, 6, 12];
6481
+ 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-"];
6480
6482
  const breakpoints = {
6481
6483
  sm: "@media (min-width: 640px)",
6482
6484
  md: "@media (min-width: 768px)",
@@ -6793,9 +6795,7 @@ function tws(classNames, convertToJson) {
6793
6795
  if (opacityValue >= 0 && opacityValue <= 100) {
6794
6796
  // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6795
6797
  // Fractions typically have denominators of 2, 3, 4, 5, 6, 12
6796
- const fractionDenominators = [2, 3, 4, 5, 6, 12];
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
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => className.startsWith(prefix) || className.startsWith(`-${prefix}`));
6799
6799
  if (!couldBeFraction) {
6800
6800
  baseClassName = className.replace(/\/\d+$/, "");
6801
6801
  hasOpacityModifier = true;
@@ -6962,9 +6962,7 @@ function processClass(cls, selector, styles) {
6962
6962
  // If it's a valid opacity value (0-100), treat it as opacity modifier
6963
6963
  if (opacityValue >= 0 && opacityValue <= 100) {
6964
6964
  // Check if this could be a fraction (e.g., w-2/3, h-1/2, top-1/2, etc.)
6965
- const fractionDenominators = [2, 3, 4, 5, 6, 12];
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));
6965
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => pureClassName.startsWith(prefix) || pureClassName.startsWith(`-${prefix}`));
6968
6966
  if (!couldBeFraction) {
6969
6967
  baseClassName = pureClassName.replace(/\/\d+$/, "");
6970
6968
  hasOpacityModifier = true;
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.8.9
2
+ * tailwind-to-style v2.8.10
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
@@ -6473,6 +6473,8 @@ if (!twString) {
6473
6473
  if (!cssObject) {
6474
6474
  cssObject = convertCssToObject(twString);
6475
6475
  }
6476
+ const fractionDenominators = [2, 3, 4, 5, 6, 12];
6477
+ 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-"];
6476
6478
  const breakpoints = {
6477
6479
  sm: "@media (min-width: 640px)",
6478
6480
  md: "@media (min-width: 768px)",
@@ -6789,9 +6791,7 @@ function tws(classNames, convertToJson) {
6789
6791
  if (opacityValue >= 0 && opacityValue <= 100) {
6790
6792
  // Check if this could be a fraction (e.g., w-2/3, h-1/2)
6791
6793
  // Fractions typically have denominators of 2, 3, 4, 5, 6, 12
6792
- const fractionDenominators = [2, 3, 4, 5, 6, 12];
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
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => className.startsWith(prefix) || className.startsWith(`-${prefix}`));
6795
6795
  if (!couldBeFraction) {
6796
6796
  baseClassName = className.replace(/\/\d+$/, "");
6797
6797
  hasOpacityModifier = true;
@@ -6958,9 +6958,7 @@ function processClass(cls, selector, styles) {
6958
6958
  // If it's a valid opacity value (0-100), treat it as opacity modifier
6959
6959
  if (opacityValue >= 0 && opacityValue <= 100) {
6960
6960
  // Check if this could be a fraction (e.g., w-2/3, h-1/2, top-1/2, etc.)
6961
- const fractionDenominators = [2, 3, 4, 5, 6, 12];
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));
6961
+ const couldBeFraction = fractionDenominators.includes(opacityValue) && fractionPrefixes.some(prefix => pureClassName.startsWith(prefix) || pureClassName.startsWith(`-${prefix}`));
6964
6962
  if (!couldBeFraction) {
6965
6963
  baseClassName = pureClassName.replace(/\/\d+$/, "");
6966
6964
  hasOpacityModifier = true;