tailwind-to-style 2.7.6 → 2.7.8
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/generated-styles.css +336 -0
- package/dist/index.browser.js +232 -110
- package/dist/index.cjs +232 -110
- package/dist/index.esm.js +232 -110
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tailwind-to-style v2.7.
|
|
2
|
+
* tailwind-to-style v2.7.8
|
|
3
3
|
* Convert tailwind classes to inline style
|
|
4
4
|
*
|
|
5
5
|
* @author Bigetion
|
|
@@ -1895,10 +1895,10 @@ function generator$2i() {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
if (value === "custom_value") {
|
|
1897
1897
|
return `
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1898
|
+
${prefix}-${key} {
|
|
1899
|
+
${isValidCssColor(value) ? "background-color" : "background"}: ${value};
|
|
1900
|
+
}
|
|
1901
|
+
`;
|
|
1902
1902
|
}
|
|
1903
1903
|
return `
|
|
1904
1904
|
${prefix}-${key} {
|
|
@@ -1920,6 +1920,7 @@ function generator$2h() {
|
|
|
1920
1920
|
theme = {}
|
|
1921
1921
|
} = configOptions;
|
|
1922
1922
|
const prefix = `${globalPrefix}bg`;
|
|
1923
|
+
const customPrefix = `${globalPrefix}bg-image`;
|
|
1923
1924
|
const {
|
|
1924
1925
|
backgroundImage = {}
|
|
1925
1926
|
} = theme;
|
|
@@ -1927,11 +1928,20 @@ function generator$2h() {
|
|
|
1927
1928
|
let {
|
|
1928
1929
|
getCssByOptions
|
|
1929
1930
|
} = _ref;
|
|
1930
|
-
const cssString = getCssByOptions(backgroundImage, (key, value) =>
|
|
1931
|
+
const cssString = getCssByOptions(backgroundImage, (key, value) => {
|
|
1932
|
+
if (value === "custom_value") {
|
|
1933
|
+
return `
|
|
1934
|
+
${customPrefix}-${key} {
|
|
1935
|
+
background-image: ${value};
|
|
1936
|
+
}
|
|
1937
|
+
`;
|
|
1938
|
+
}
|
|
1939
|
+
return `
|
|
1931
1940
|
${prefix}-${key} {
|
|
1932
1941
|
background-image: ${value};
|
|
1933
1942
|
}
|
|
1934
|
-
|
|
1943
|
+
`;
|
|
1944
|
+
});
|
|
1935
1945
|
return cssString;
|
|
1936
1946
|
}, configOptions);
|
|
1937
1947
|
return responsiveCssString;
|
|
@@ -1994,6 +2004,7 @@ function generator$2e() {
|
|
|
1994
2004
|
theme = {}
|
|
1995
2005
|
} = configOptions;
|
|
1996
2006
|
const prefix = `${globalPrefix}bg`;
|
|
2007
|
+
const customPrefix = `${globalPrefix}bg-position`;
|
|
1997
2008
|
const {
|
|
1998
2009
|
backgroundPosition = {}
|
|
1999
2010
|
} = theme;
|
|
@@ -2001,11 +2012,20 @@ function generator$2e() {
|
|
|
2001
2012
|
let {
|
|
2002
2013
|
getCssByOptions
|
|
2003
2014
|
} = _ref;
|
|
2004
|
-
const cssString = getCssByOptions(backgroundPosition, (key, value) =>
|
|
2015
|
+
const cssString = getCssByOptions(backgroundPosition, (key, value) => {
|
|
2016
|
+
if (value === "custom_value") {
|
|
2017
|
+
return `
|
|
2018
|
+
${customPrefix}-${key} {
|
|
2019
|
+
background-position: ${value};
|
|
2020
|
+
}
|
|
2021
|
+
`;
|
|
2022
|
+
}
|
|
2023
|
+
return `
|
|
2005
2024
|
${prefix}-${key} {
|
|
2006
2025
|
background-position: ${value};
|
|
2007
2026
|
}
|
|
2008
|
-
|
|
2027
|
+
`;
|
|
2028
|
+
});
|
|
2009
2029
|
return cssString;
|
|
2010
2030
|
}, configOptions);
|
|
2011
2031
|
return responsiveCssString;
|
|
@@ -2046,6 +2066,7 @@ function generator$2c() {
|
|
|
2046
2066
|
theme = {}
|
|
2047
2067
|
} = configOptions;
|
|
2048
2068
|
const prefix = `${globalPrefix}bg`;
|
|
2069
|
+
const customPrefix = `${globalPrefix}bg-size`;
|
|
2049
2070
|
const {
|
|
2050
2071
|
backgroundSize = {}
|
|
2051
2072
|
} = theme;
|
|
@@ -2053,11 +2074,20 @@ function generator$2c() {
|
|
|
2053
2074
|
let {
|
|
2054
2075
|
getCssByOptions
|
|
2055
2076
|
} = _ref;
|
|
2056
|
-
const cssString = getCssByOptions(backgroundSize, (key, value) =>
|
|
2077
|
+
const cssString = getCssByOptions(backgroundSize, (key, value) => {
|
|
2078
|
+
if (value === "custom_value") {
|
|
2079
|
+
return `
|
|
2080
|
+
${customPrefix}-${key} {
|
|
2081
|
+
background-size: ${value};
|
|
2082
|
+
}
|
|
2083
|
+
`;
|
|
2084
|
+
}
|
|
2085
|
+
return `
|
|
2057
2086
|
${prefix}-${key} {
|
|
2058
2087
|
background-size: ${value};
|
|
2059
2088
|
}
|
|
2060
|
-
|
|
2089
|
+
`;
|
|
2090
|
+
});
|
|
2061
2091
|
return cssString;
|
|
2062
2092
|
}, configOptions);
|
|
2063
2093
|
return responsiveCssString;
|
|
@@ -2125,6 +2155,7 @@ function generator$29() {
|
|
|
2125
2155
|
theme = {}
|
|
2126
2156
|
} = configOptions;
|
|
2127
2157
|
const prefix = `${globalPrefix}border`;
|
|
2158
|
+
const customPrefix = `${globalPrefix}border-color`;
|
|
2128
2159
|
const {
|
|
2129
2160
|
borderColor = {}
|
|
2130
2161
|
} = theme;
|
|
@@ -2141,57 +2172,64 @@ function generator$29() {
|
|
|
2141
2172
|
if (rgbValue) {
|
|
2142
2173
|
rgbPropertyValue = `border-color: rgba(${rgbValue}, var(--border-opacity));`;
|
|
2143
2174
|
}
|
|
2175
|
+
if (value === "custom_value") {
|
|
2176
|
+
return `
|
|
2177
|
+
${customPrefix}${key} {
|
|
2178
|
+
border-color: ${value};
|
|
2179
|
+
}
|
|
2180
|
+
`;
|
|
2181
|
+
}
|
|
2144
2182
|
return `
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2183
|
+
${prefix}${key} {
|
|
2184
|
+
--border-opacity: 1;
|
|
2185
|
+
border-color: ${value};
|
|
2186
|
+
${rgbPropertyValue}
|
|
2187
|
+
}
|
|
2188
|
+
${prefix}-x${key} {
|
|
2189
|
+
--border-opacity: 1;
|
|
2190
|
+
border-left-color: ${value};
|
|
2191
|
+
${rgbPropertyValue}
|
|
2192
|
+
border-right-color: ${value};
|
|
2193
|
+
${rgbPropertyValue}
|
|
2194
|
+
}
|
|
2195
|
+
${prefix}-y${key} {
|
|
2196
|
+
--border-opacity: 1;
|
|
2197
|
+
border-top-color: ${value};
|
|
2198
|
+
${rgbPropertyValue}
|
|
2199
|
+
border-bottom-color: ${value};
|
|
2200
|
+
${rgbPropertyValue}
|
|
2201
|
+
}
|
|
2202
|
+
${prefix}-s${key} {
|
|
2203
|
+
--border-opacity: 1;
|
|
2204
|
+
border-inline-start-color: ${value};
|
|
2205
|
+
${rgbPropertyValue}
|
|
2206
|
+
}
|
|
2207
|
+
${prefix}-e${key} {
|
|
2208
|
+
--border-opacity: 1;
|
|
2209
|
+
border-inline-end-color: ${value};
|
|
2210
|
+
${rgbPropertyValue}
|
|
2211
|
+
}
|
|
2212
|
+
${prefix}-t${key} {
|
|
2213
|
+
--border-opacity: 1;
|
|
2214
|
+
border-top-color: ${value};
|
|
2215
|
+
${rgbPropertyValue}
|
|
2216
|
+
}
|
|
2217
|
+
${prefix}-r${key} {
|
|
2218
|
+
--border-opacity: 1;
|
|
2219
|
+
border-right-color: ${value};
|
|
2220
|
+
${rgbPropertyValue}
|
|
2221
|
+
}
|
|
2222
|
+
${prefix}-b${key} {
|
|
2223
|
+
--border-opacity: 1;
|
|
2224
|
+
border-bottom-color: ${value};
|
|
2225
|
+
${rgbPropertyValue}
|
|
2226
|
+
}
|
|
2227
|
+
${prefix}-l${key} {
|
|
2228
|
+
--border-opacity: 1;
|
|
2229
|
+
border-left-color: ${value};
|
|
2230
|
+
${rgbPropertyValue}
|
|
2231
|
+
}
|
|
2232
|
+
`;
|
|
2195
2233
|
});
|
|
2196
2234
|
return cssString;
|
|
2197
2235
|
}, configOptions);
|
|
@@ -2360,6 +2398,7 @@ function generator$24() {
|
|
|
2360
2398
|
theme = {}
|
|
2361
2399
|
} = configOptions;
|
|
2362
2400
|
const prefix = `${globalPrefix}border`;
|
|
2401
|
+
const customPrefix = `${globalPrefix}border-width`;
|
|
2363
2402
|
const {
|
|
2364
2403
|
borderWidth = {}
|
|
2365
2404
|
} = theme;
|
|
@@ -2369,41 +2408,48 @@ function generator$24() {
|
|
|
2369
2408
|
} = _ref;
|
|
2370
2409
|
const cssString = getCssByOptions(borderWidth, (keyTmp, value) => {
|
|
2371
2410
|
const key = keyTmp.toLowerCase() !== "default" ? `-${keyTmp}` : "";
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
border-
|
|
2376
|
-
border-bottom-width: ${value};
|
|
2377
|
-
border-left-width: ${value};
|
|
2378
|
-
border-right-width: ${value};
|
|
2379
|
-
}
|
|
2380
|
-
${prefix}-x${key} {
|
|
2381
|
-
border-left-width: ${value};
|
|
2382
|
-
border-right-width: ${value};
|
|
2383
|
-
}
|
|
2384
|
-
${prefix}-y${key} {
|
|
2385
|
-
border-top-width: ${value};
|
|
2386
|
-
border-bottom-width: ${value};
|
|
2387
|
-
}
|
|
2388
|
-
${prefix}-s${key} {
|
|
2389
|
-
border-inline-start-width: ${value};
|
|
2390
|
-
}
|
|
2391
|
-
${prefix}-e${key} {
|
|
2392
|
-
border-inline-end-width: ${value};
|
|
2393
|
-
}
|
|
2394
|
-
${prefix}-t${key} {
|
|
2395
|
-
border-top-width: ${value};
|
|
2396
|
-
}
|
|
2397
|
-
${prefix}-r${key} {
|
|
2398
|
-
border-right-width: ${value};
|
|
2399
|
-
}
|
|
2400
|
-
${prefix}-b${key} {
|
|
2401
|
-
border-bottom-width: ${value};
|
|
2402
|
-
}
|
|
2403
|
-
${prefix}-l${key} {
|
|
2404
|
-
border-left-width: ${value};
|
|
2411
|
+
if (value === "custom_value") {
|
|
2412
|
+
return `
|
|
2413
|
+
${customPrefix}-${key} {
|
|
2414
|
+
border-width: ${value};
|
|
2405
2415
|
}
|
|
2406
2416
|
`;
|
|
2417
|
+
}
|
|
2418
|
+
return `
|
|
2419
|
+
${prefix}${key} {
|
|
2420
|
+
border-style: solid;
|
|
2421
|
+
border-top-width: ${value};
|
|
2422
|
+
border-bottom-width: ${value};
|
|
2423
|
+
border-left-width: ${value};
|
|
2424
|
+
border-right-width: ${value};
|
|
2425
|
+
}
|
|
2426
|
+
${prefix}-x${key} {
|
|
2427
|
+
border-left-width: ${value};
|
|
2428
|
+
border-right-width: ${value};
|
|
2429
|
+
}
|
|
2430
|
+
${prefix}-y${key} {
|
|
2431
|
+
border-top-width: ${value};
|
|
2432
|
+
border-bottom-width: ${value};
|
|
2433
|
+
}
|
|
2434
|
+
${prefix}-s${key} {
|
|
2435
|
+
border-inline-start-width: ${value};
|
|
2436
|
+
}
|
|
2437
|
+
${prefix}-e${key} {
|
|
2438
|
+
border-inline-end-width: ${value};
|
|
2439
|
+
}
|
|
2440
|
+
${prefix}-t${key} {
|
|
2441
|
+
border-top-width: ${value};
|
|
2442
|
+
}
|
|
2443
|
+
${prefix}-r${key} {
|
|
2444
|
+
border-right-width: ${value};
|
|
2445
|
+
}
|
|
2446
|
+
${prefix}-b${key} {
|
|
2447
|
+
border-bottom-width: ${value};
|
|
2448
|
+
}
|
|
2449
|
+
${prefix}-l${key} {
|
|
2450
|
+
border-left-width: ${value};
|
|
2451
|
+
}
|
|
2452
|
+
`;
|
|
2407
2453
|
});
|
|
2408
2454
|
return cssString;
|
|
2409
2455
|
}, configOptions);
|
|
@@ -2439,6 +2485,7 @@ function generator$22() {
|
|
|
2439
2485
|
theme = {}
|
|
2440
2486
|
} = configOptions;
|
|
2441
2487
|
const prefix = `${globalPrefix}shadow`;
|
|
2488
|
+
const customPrefix = `${globalPrefix}box-shadow`;
|
|
2442
2489
|
const {
|
|
2443
2490
|
boxShadowColor,
|
|
2444
2491
|
boxShadow = {}
|
|
@@ -2451,6 +2498,13 @@ function generator$22() {
|
|
|
2451
2498
|
let cssString = getCssByOptions(boxShadow, (keyTmp, value) => {
|
|
2452
2499
|
const key = keyTmp.toLowerCase() !== "default" ? `-${keyTmp}` : "";
|
|
2453
2500
|
const valueSplit = value.split(" ");
|
|
2501
|
+
if (value === "custom_value") {
|
|
2502
|
+
return `
|
|
2503
|
+
${customPrefix}${key} {
|
|
2504
|
+
box-shadow: ${value};
|
|
2505
|
+
}
|
|
2506
|
+
`;
|
|
2507
|
+
}
|
|
2454
2508
|
return `
|
|
2455
2509
|
${prefix}${key} {
|
|
2456
2510
|
--shadow: ${value};
|
|
@@ -3083,6 +3137,7 @@ function generator$1G() {
|
|
|
3083
3137
|
theme = {}
|
|
3084
3138
|
} = configOptions;
|
|
3085
3139
|
const prefix = `${globalPrefix}text`;
|
|
3140
|
+
const customPrefix = `${globalPrefix}text-size`;
|
|
3086
3141
|
const {
|
|
3087
3142
|
fontSize = {}
|
|
3088
3143
|
} = theme;
|
|
@@ -3090,11 +3145,20 @@ function generator$1G() {
|
|
|
3090
3145
|
let {
|
|
3091
3146
|
getCssByOptions
|
|
3092
3147
|
} = _ref;
|
|
3093
|
-
const cssString = getCssByOptions(fontSize, (key, value) =>
|
|
3148
|
+
const cssString = getCssByOptions(fontSize, (key, value) => {
|
|
3149
|
+
if (value === "custom_value") {
|
|
3150
|
+
return `
|
|
3151
|
+
${customPrefix}${key} {
|
|
3152
|
+
font-size: ${value};
|
|
3153
|
+
}
|
|
3154
|
+
`;
|
|
3155
|
+
}
|
|
3156
|
+
return `
|
|
3094
3157
|
${prefix}-${key} {
|
|
3095
3158
|
font-size: ${value};
|
|
3096
3159
|
}
|
|
3097
|
-
|
|
3160
|
+
`;
|
|
3161
|
+
});
|
|
3098
3162
|
return cssString;
|
|
3099
3163
|
}, configOptions);
|
|
3100
3164
|
return responsiveCssString;
|
|
@@ -4243,6 +4307,7 @@ function generator$$() {
|
|
|
4243
4307
|
theme = {}
|
|
4244
4308
|
} = configOptions;
|
|
4245
4309
|
const prefix = `${globalPrefix}outline`;
|
|
4310
|
+
const customPrefix = `${globalPrefix}outline-color`;
|
|
4246
4311
|
const {
|
|
4247
4312
|
outlineColor = {}
|
|
4248
4313
|
} = theme;
|
|
@@ -4259,6 +4324,13 @@ function generator$$() {
|
|
|
4259
4324
|
if (rgbValue) {
|
|
4260
4325
|
rgbPropertyValue = `outline-color: rgba(${rgbValue}, var(--outline-opacity));`;
|
|
4261
4326
|
}
|
|
4327
|
+
if (value === "custom_value") {
|
|
4328
|
+
return `
|
|
4329
|
+
${customPrefix}${key} {
|
|
4330
|
+
outline-color: ${value};
|
|
4331
|
+
}
|
|
4332
|
+
`;
|
|
4333
|
+
}
|
|
4262
4334
|
return `
|
|
4263
4335
|
${prefix}${key} {
|
|
4264
4336
|
--outline-opacity: 1;
|
|
@@ -4364,6 +4436,7 @@ function generator$X() {
|
|
|
4364
4436
|
theme = {}
|
|
4365
4437
|
} = configOptions;
|
|
4366
4438
|
const prefix = `${globalPrefix}outline`;
|
|
4439
|
+
const customPrefix = `${globalPrefix}outline-width`;
|
|
4367
4440
|
const {
|
|
4368
4441
|
outlineWidth = {}
|
|
4369
4442
|
} = theme;
|
|
@@ -4372,11 +4445,18 @@ function generator$X() {
|
|
|
4372
4445
|
getCssByOptions
|
|
4373
4446
|
} = _ref;
|
|
4374
4447
|
const cssString = getCssByOptions(outlineWidth, (key, value) => {
|
|
4375
|
-
|
|
4376
|
-
|
|
4448
|
+
if (value === "custom_value") {
|
|
4449
|
+
return `
|
|
4450
|
+
${customPrefix}-${key} {
|
|
4377
4451
|
outline-width: ${value};
|
|
4378
4452
|
}
|
|
4379
4453
|
`;
|
|
4454
|
+
}
|
|
4455
|
+
return `
|
|
4456
|
+
${prefix}-${key} {
|
|
4457
|
+
outline-width: ${value};
|
|
4458
|
+
}
|
|
4459
|
+
`;
|
|
4380
4460
|
});
|
|
4381
4461
|
return cssString;
|
|
4382
4462
|
}, configOptions);
|
|
@@ -5357,6 +5437,7 @@ function generator$r() {
|
|
|
5357
5437
|
theme = {}
|
|
5358
5438
|
} = configOptions;
|
|
5359
5439
|
const prefix = `${globalPrefix}text`;
|
|
5440
|
+
const customPrefix = `${globalPrefix}text-color`;
|
|
5360
5441
|
const {
|
|
5361
5442
|
textColor
|
|
5362
5443
|
} = theme;
|
|
@@ -5369,13 +5450,20 @@ function generator$r() {
|
|
|
5369
5450
|
if (rgbValue) {
|
|
5370
5451
|
rgbPropertyValue = `color: rgba(${rgbValue}, var(--text-opacity));`;
|
|
5371
5452
|
}
|
|
5453
|
+
if (value === "custom_value") {
|
|
5454
|
+
return `
|
|
5455
|
+
${customPrefix}-${key} {
|
|
5456
|
+
color: ${value};
|
|
5457
|
+
}
|
|
5458
|
+
`;
|
|
5459
|
+
}
|
|
5372
5460
|
return `
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5461
|
+
${prefix}-${key} {
|
|
5462
|
+
--text-opacity: 1;
|
|
5463
|
+
color: ${value};
|
|
5464
|
+
${rgbPropertyValue}
|
|
5465
|
+
}
|
|
5466
|
+
`;
|
|
5379
5467
|
});
|
|
5380
5468
|
return cssString;
|
|
5381
5469
|
}, configOptions);
|
|
@@ -6690,11 +6778,29 @@ function tws(classNames, convertToJson) {
|
|
|
6690
6778
|
const processMarker = performanceMonitor.start("tws:process");
|
|
6691
6779
|
let cssResult = classes.map(className => {
|
|
6692
6780
|
// Extract base class name without opacity modifier
|
|
6693
|
-
|
|
6694
|
-
|
|
6781
|
+
// Only remove /digits if it's an opacity modifier (not a fraction like w-2/3)
|
|
6782
|
+
// Opacity modifiers are typically /0-100, fractions are /2, /3, /4, /5, /6, /12
|
|
6783
|
+
const opacityMatch = className.match(/\/(\d+)$/);
|
|
6784
|
+
let baseClassName = className;
|
|
6785
|
+
let hasOpacityModifier = false;
|
|
6786
|
+
if (opacityMatch) {
|
|
6787
|
+
const opacityValue = parseInt(opacityMatch[1], 10);
|
|
6788
|
+
// If it's a valid opacity value (0-100), treat it as opacity modifier
|
|
6789
|
+
if (opacityValue >= 0 && opacityValue <= 100) {
|
|
6790
|
+
// Check if this could be a fraction (e.g., w-2/3, h-1/2)
|
|
6791
|
+
// Fractions typically have denominators of 2, 3, 4, 5, 6, 12
|
|
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-'));
|
|
6794
|
+
if (!couldBeFraction) {
|
|
6795
|
+
baseClassName = className.replace(/\/\d+$/, "");
|
|
6796
|
+
hasOpacityModifier = true;
|
|
6797
|
+
}
|
|
6798
|
+
}
|
|
6799
|
+
}
|
|
6800
|
+
let result = cssObject[baseClassName] || cssObject[baseClassName.replace(/\//g, "\\/")] || cssObject[baseClassName.replace(/\./g, "\\.")];
|
|
6695
6801
|
if (result) {
|
|
6696
6802
|
// Apply opacity modifier if present
|
|
6697
|
-
if (className.includes("/") && /\/\d+$/.test(className)) {
|
|
6803
|
+
if (hasOpacityModifier && className.includes("/") && /\/\d+$/.test(className)) {
|
|
6698
6804
|
result = processOpacityModifier(className, result);
|
|
6699
6805
|
}
|
|
6700
6806
|
return resolveCssToClearCss(result);
|
|
@@ -6706,7 +6812,7 @@ function tws(classNames, convertToJson) {
|
|
|
6706
6812
|
if (cssObject[`${baseKey}custom`]) {
|
|
6707
6813
|
let customResult = cssObject[`${baseKey}custom`].replace(/custom_value/g, customValue);
|
|
6708
6814
|
// Apply opacity modifier to custom values too
|
|
6709
|
-
if (className.includes("/") && /\/\d+$/.test(className)) {
|
|
6815
|
+
if (hasOpacityModifier && className.includes("/") && /\/\d+$/.test(className)) {
|
|
6710
6816
|
customResult = processOpacityModifier(className, customResult);
|
|
6711
6817
|
}
|
|
6712
6818
|
return customResult;
|
|
@@ -6842,7 +6948,23 @@ function processClass(cls, selector, styles) {
|
|
|
6842
6948
|
} = resolveVariants(selector, rawVariants);
|
|
6843
6949
|
|
|
6844
6950
|
// Extract base class name without opacity modifier for CSS lookup
|
|
6845
|
-
|
|
6951
|
+
// Only remove /digits if it's an opacity modifier (not a fraction like w-2/3)
|
|
6952
|
+
const opacityMatch = pureClassName.match(/\/(\d+)$/);
|
|
6953
|
+
let baseClassName = pureClassName;
|
|
6954
|
+
let hasOpacityModifier = false;
|
|
6955
|
+
if (opacityMatch) {
|
|
6956
|
+
const opacityValue = parseInt(opacityMatch[1], 10);
|
|
6957
|
+
// If it's a valid opacity value (0-100), treat it as opacity modifier
|
|
6958
|
+
if (opacityValue >= 0 && opacityValue <= 100) {
|
|
6959
|
+
// Check if this could be a fraction (e.g., w-2/3, h-1/2)
|
|
6960
|
+
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
|
+
if (!couldBeFraction) {
|
|
6963
|
+
baseClassName = pureClassName.replace(/\/\d+$/, "");
|
|
6964
|
+
hasOpacityModifier = true;
|
|
6965
|
+
}
|
|
6966
|
+
}
|
|
6967
|
+
}
|
|
6846
6968
|
let declarations = cssObject[baseClassName] || cssObject[baseClassName.replace(/(\/)/g, "\\$1")] || cssObject[baseClassName.replace(/\./g, "\\.")];
|
|
6847
6969
|
if (!declarations && baseClassName.includes("[")) {
|
|
6848
6970
|
const match = baseClassName.match(/^(.+?)\[(.+)\]$/);
|
|
@@ -6863,7 +6985,7 @@ function processClass(cls, selector, styles) {
|
|
|
6863
6985
|
}
|
|
6864
6986
|
|
|
6865
6987
|
// Apply opacity modifier if present
|
|
6866
|
-
if (pureClassName.includes("/") && /\/\d+$/.test(pureClassName)) {
|
|
6988
|
+
if (hasOpacityModifier && pureClassName.includes("/") && /\/\d+$/.test(pureClassName)) {
|
|
6867
6989
|
declarations = processOpacityModifier(pureClassName, declarations);
|
|
6868
6990
|
}
|
|
6869
6991
|
if (isImportant) {
|