@react-email/tailwind 2.0.0-tailwindv4.1 → 2.0.0-tailwindv4.3
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.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +100 -76
- package/dist/index.mjs +100 -76
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React$1 from "react";
|
|
|
2
2
|
import { Config } from "tailwindcss";
|
|
3
3
|
|
|
4
4
|
//#region src/tailwind.d.ts
|
|
5
|
-
type TailwindConfig =
|
|
5
|
+
type TailwindConfig = Omit<Config, 'content'>;
|
|
6
6
|
interface TailwindProps {
|
|
7
7
|
children: React$1.ReactNode;
|
|
8
8
|
config?: TailwindConfig;
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tailwind.tsx"],"sourcesContent":[],"mappings":";;;;KAaY,cAAA,GAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tailwind.tsx"],"sourcesContent":[],"mappings":";;;;KAaY,cAAA,GAAiB,KAAK;UAEjB,aAAA;EAFL,QAAA,EAGA,OAAA,CAAM,SAHQ;EAAA,MAAA,CAAA,EAIf,cAJe;;AAAG,UAOZ,iBAAA,CAPY;EAAI,QAAA,CAAA,EAQpB,OAAA,CAAM,SARc;EAEhB,SAAA,CAAA,EAAA,MAAa;EAAA,KAAA,CAAA,EAQpB,OAAA,CAAM,aARc;;AAEnB,cASE,gBATF,EASoB,cATpB;AAAc,iBAoET,QAAA,CApES;EAAA,QAAA;EAAA;AAAA,CAAA,EAoEsB,aApEtB,CAAA,EAoEmC,OAAA,CAAA,SApEnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { Config } from "tailwindcss";
|
|
3
3
|
|
|
4
4
|
//#region src/tailwind.d.ts
|
|
5
|
-
type TailwindConfig =
|
|
5
|
+
type TailwindConfig = Omit<Config, 'content'>;
|
|
6
6
|
interface TailwindProps {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
config?: TailwindConfig;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tailwind.tsx"],"sourcesContent":[],"mappings":";;;;KAaY,cAAA,GAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tailwind.tsx"],"sourcesContent":[],"mappings":";;;;KAaY,cAAA,GAAiB,KAAK;UAEjB,aAAA;EAFL,QAAA,EAGA,KAAA,CAAM,SAHQ;EAAA,MAAA,CAAA,EAIf,cAJe;;AAAG,UAOZ,iBAAA,CAPY;EAAI,QAAA,CAAA,EAQpB,KAAA,CAAM,SARc;EAEhB,SAAA,CAAA,EAAA,MAAa;EAAA,KAAA,CAAA,EAQpB,KAAA,CAAM,aARc;;AAEnB,cASE,gBATF,EASoB,cATpB;AAAc,iBAoET,QAAA,CApES;EAAA,QAAA;EAAA;AAAA,CAAA,EAoEsB,aApEtB,CAAA,EAoEmC,KAAA,CAAA,SApEnC"}
|
package/dist/index.js
CHANGED
|
@@ -1079,9 +1079,7 @@ function sourceFragment({ source, line, column, baseLine, baseColumn }, extraLin
|
|
|
1079
1079
|
function processLines(start, end) {
|
|
1080
1080
|
return lines.slice(start, end).map((line$1, idx) => String(start + idx + 1).padStart(maxNumLength) + " |" + line$1).join("\n");
|
|
1081
1081
|
}
|
|
1082
|
-
const
|
|
1083
|
-
const precolumns = " ".repeat(Math.max(baseColumn - 1, 0));
|
|
1084
|
-
const lines = (prelines + precolumns + source).split(/\r\n?|\n|\f/);
|
|
1082
|
+
const lines = ("\n".repeat(Math.max(baseLine - 1, 0)) + " ".repeat(Math.max(baseColumn - 1, 0)) + source).split(/\r\n?|\n|\f/);
|
|
1085
1083
|
const startLine = Math.max(1, line - extraLines) - 1;
|
|
1086
1084
|
const endLine = Math.min(line + extraLines, lines.length + 1);
|
|
1087
1085
|
const maxNumLength = Math.max(4, String(endLine).length) + 1;
|
|
@@ -1364,8 +1362,7 @@ function createParser(config) {
|
|
|
1364
1362
|
if (typeof onComment === "function") parser.forEachToken((type, start, end) => {
|
|
1365
1363
|
if (type === Comment) {
|
|
1366
1364
|
const loc = parser.getLocation(start, end);
|
|
1367
|
-
|
|
1368
|
-
onComment(value, loc);
|
|
1365
|
+
onComment(cmpStr(source, end - 2, end, "*/") ? source.slice(start + 2, end - 2) : source.slice(start + 2, end), loc);
|
|
1369
1366
|
}
|
|
1370
1367
|
});
|
|
1371
1368
|
const ast = parser.context[context].call(parser, options);
|
|
@@ -4800,8 +4797,7 @@ function processStructure(name$49, nodeType) {
|
|
|
4800
4797
|
const docs = { type: "\"" + name$49 + "\"" };
|
|
4801
4798
|
for (const key in structure$49) {
|
|
4802
4799
|
if (hasOwnProperty$1.call(structure$49, key) === false) continue;
|
|
4803
|
-
|
|
4804
|
-
docs[key] = genTypesList(fieldTypes, name$49 + "." + key);
|
|
4800
|
+
docs[key] = genTypesList(fields[key] = Array.isArray(structure$49[key]) ? structure$49[key].slice() : [structure$49[key]], name$49 + "." + key);
|
|
4805
4801
|
}
|
|
4806
4802
|
return {
|
|
4807
4803
|
docs,
|
|
@@ -19090,9 +19086,7 @@ function populateParentsForNodeTree(node) {
|
|
|
19090
19086
|
//#endregion
|
|
19091
19087
|
//#region src/utils/css/resolve-all-css-variables.ts
|
|
19092
19088
|
function doSelectorsIntersect(first, second) {
|
|
19093
|
-
|
|
19094
|
-
const secondStringified = generate(second);
|
|
19095
|
-
if (firstStringified === secondStringified) return true;
|
|
19089
|
+
if (generate(first) === generate(second)) return true;
|
|
19096
19090
|
let hasSomeUniversal = false;
|
|
19097
19091
|
const walker = (node) => {
|
|
19098
19092
|
if (hasSomeUniversal) return;
|
|
@@ -19104,12 +19098,6 @@ function doSelectorsIntersect(first, second) {
|
|
|
19104
19098
|
if (hasSomeUniversal) return true;
|
|
19105
19099
|
return false;
|
|
19106
19100
|
}
|
|
19107
|
-
function removeAndRepeatIfEmptyRecursively(node) {
|
|
19108
|
-
if (node.parent) if (node.containedIn && node.containingItem) {
|
|
19109
|
-
node.containedIn.remove(node.containingItem);
|
|
19110
|
-
if (node.containedIn.isEmpty) removeAndRepeatIfEmptyRecursively(node.parent);
|
|
19111
|
-
} else removeAndRepeatIfEmptyRecursively(node.parent);
|
|
19112
|
-
}
|
|
19113
19101
|
function someParent(node, predicate) {
|
|
19114
19102
|
if (node.parent) {
|
|
19115
19103
|
if (predicate(node.parent)) return true;
|
|
@@ -19127,11 +19115,8 @@ function resolveAllCssVariables(node) {
|
|
|
19127
19115
|
if (someParent(declaration, (ancestor) => ancestor.type === "Atrule" && ancestor.name === "layer" && ancestor.prelude !== null && generate(ancestor.prelude).includes("properties"))) return;
|
|
19128
19116
|
if (/--[\S]+/.test(declaration.property)) variableDefinitions.add({
|
|
19129
19117
|
declaration,
|
|
19130
|
-
variableName:
|
|
19131
|
-
definition: generate(declaration.value)
|
|
19132
|
-
remove() {
|
|
19133
|
-
removeAndRepeatIfEmptyRecursively(declaration);
|
|
19134
|
-
}
|
|
19118
|
+
variableName: declaration.property,
|
|
19119
|
+
definition: generate(declaration.value)
|
|
19135
19120
|
});
|
|
19136
19121
|
else {
|
|
19137
19122
|
function parseVariableUsesFrom(node$1) {
|
|
@@ -19148,10 +19133,7 @@ function resolveAllCssVariables(node) {
|
|
|
19148
19133
|
variableName: name$49,
|
|
19149
19134
|
raw: generate(funcNode)
|
|
19150
19135
|
});
|
|
19151
|
-
if (fallback?.includes("var(")) {
|
|
19152
|
-
const parsedFallback = parse(fallback, { context: "value" });
|
|
19153
|
-
parseVariableUsesFrom(parsedFallback);
|
|
19154
|
-
}
|
|
19136
|
+
if (fallback?.includes("var(")) parseVariableUsesFrom(parse(fallback, { context: "value" }));
|
|
19155
19137
|
}
|
|
19156
19138
|
}
|
|
19157
19139
|
});
|
|
@@ -19177,7 +19159,6 @@ function resolveAllCssVariables(node) {
|
|
|
19177
19159
|
}
|
|
19178
19160
|
if (!hasReplaced && use.fallback) use.declaration.value = parse(generate(use.declaration.value).replaceAll(use.raw, use.fallback), { context: "value" });
|
|
19179
19161
|
}
|
|
19180
|
-
for (const definition of variableDefinitions) definition.remove();
|
|
19181
19162
|
}
|
|
19182
19163
|
|
|
19183
19164
|
//#endregion
|
|
@@ -19193,7 +19174,7 @@ function resolveCalcExpressions(node) {
|
|
|
19193
19174
|
func.children.forEach((child, item) => {
|
|
19194
19175
|
const left = item.prev;
|
|
19195
19176
|
const right = item.next;
|
|
19196
|
-
if (left && right && child.type === "Operator" && (left.data.type === "Dimension" || left.data.type === "Number") && (right.data.type === "Dimension" || right.data.type === "Number")) {
|
|
19177
|
+
if (left && right && child.type === "Operator" && (left.data.type === "Dimension" || left.data.type === "Number" || left.data.type === "Percentage") && (right.data.type === "Dimension" || right.data.type === "Number" || right.data.type === "Percentage")) {
|
|
19197
19178
|
if (child.value === "*" || child.value === "/") {
|
|
19198
19179
|
const value = (() => {
|
|
19199
19180
|
if (child.value === "*") return String(Number.parseFloat(left.data.value) * Number.parseFloat(right.data.value));
|
|
@@ -19235,6 +19216,31 @@ function resolveCalcExpressions(node) {
|
|
|
19235
19216
|
};
|
|
19236
19217
|
func.children.remove(left);
|
|
19237
19218
|
func.children.remove(right);
|
|
19219
|
+
} else if (left.data.type === "Percentage" && right.data.type === "Number") {
|
|
19220
|
+
item.data = {
|
|
19221
|
+
type: "Percentage",
|
|
19222
|
+
value
|
|
19223
|
+
};
|
|
19224
|
+
func.children.remove(left);
|
|
19225
|
+
func.children.remove(right);
|
|
19226
|
+
} else if (left.data.type === "Number" && right.data.type === "Percentage") {
|
|
19227
|
+
item.data = {
|
|
19228
|
+
type: "Percentage",
|
|
19229
|
+
value
|
|
19230
|
+
};
|
|
19231
|
+
func.children.remove(left);
|
|
19232
|
+
func.children.remove(right);
|
|
19233
|
+
} else if (left.data.type === "Percentage" && right.data.type === "Percentage") {
|
|
19234
|
+
if (child.value === "/") item.data = {
|
|
19235
|
+
type: "Number",
|
|
19236
|
+
value
|
|
19237
|
+
};
|
|
19238
|
+
else item.data = {
|
|
19239
|
+
type: "Percentage",
|
|
19240
|
+
value
|
|
19241
|
+
};
|
|
19242
|
+
func.children.remove(left);
|
|
19243
|
+
func.children.remove(right);
|
|
19238
19244
|
}
|
|
19239
19245
|
}
|
|
19240
19246
|
}
|
|
@@ -19278,10 +19284,6 @@ function lrgbToRgb(input) {
|
|
|
19278
19284
|
function clamp(value, min, max) {
|
|
19279
19285
|
return Math.min(Math.max(value, min), max);
|
|
19280
19286
|
}
|
|
19281
|
-
function round(value, digits = 1) {
|
|
19282
|
-
const factor = 10 ** digits;
|
|
19283
|
-
return Math.round(value * factor) / factor;
|
|
19284
|
-
}
|
|
19285
19287
|
function oklchToOklab(oklch) {
|
|
19286
19288
|
return {
|
|
19287
19289
|
l: oklch.l,
|
|
@@ -19299,9 +19301,9 @@ function oklchToRgb(oklch) {
|
|
|
19299
19301
|
const g = 255 * lrgbToRgb(LSM_TO_RGB.g[0] * l + LSM_TO_RGB.g[1] * m + LSM_TO_RGB.g[2] * s);
|
|
19300
19302
|
const b = 255 * lrgbToRgb(LSM_TO_RGB.b[0] * l + LSM_TO_RGB.b[1] * m + LSM_TO_RGB.b[2] * s);
|
|
19301
19303
|
return {
|
|
19302
|
-
r:
|
|
19303
|
-
g:
|
|
19304
|
-
b:
|
|
19304
|
+
r: clamp(r, 0, 255).toFixed(0),
|
|
19305
|
+
g: clamp(g, 0, 255).toFixed(0),
|
|
19306
|
+
b: clamp(b, 0, 255).toFixed(0)
|
|
19305
19307
|
};
|
|
19306
19308
|
}
|
|
19307
19309
|
function separteShorthandDeclaration(shorthandToReplace, [start, end]) {
|
|
@@ -19445,48 +19447,47 @@ function sanitizeDeclarations(nodeContainingDeclarations) {
|
|
|
19445
19447
|
enter(hash, hashParentListItem) {
|
|
19446
19448
|
const hex = hash.value.trim();
|
|
19447
19449
|
if (hex.length === 3) {
|
|
19448
|
-
|
|
19449
|
-
const g$1 = Number.parseInt(hex.charAt(1) + hex.charAt(1), 16);
|
|
19450
|
-
const b$1 = Number.parseInt(hex.charAt(2) + hex.charAt(2), 16);
|
|
19451
|
-
hashParentListItem.data = parse(`rgb(${r$1},${g$1},${b$1})`, { context: "value" });
|
|
19450
|
+
hashParentListItem.data = parse(`rgb(${Number.parseInt(hex.charAt(0) + hex.charAt(0), 16)},${Number.parseInt(hex.charAt(1) + hex.charAt(1), 16)},${Number.parseInt(hex.charAt(2) + hex.charAt(2), 16)})`, { context: "value" });
|
|
19452
19451
|
return;
|
|
19453
19452
|
}
|
|
19454
19453
|
if (hex.length === 4) {
|
|
19455
|
-
|
|
19456
|
-
const g$1 = Number.parseInt(hex.charAt(1) + hex.charAt(1), 16);
|
|
19457
|
-
const b$1 = Number.parseInt(hex.charAt(2) + hex.charAt(2), 16);
|
|
19458
|
-
const a$1 = Number.parseInt(hex.charAt(3) + hex.charAt(3), 16) / 255;
|
|
19459
|
-
hashParentListItem.data = parse(`rgb(${r$1},${g$1},${b$1},${a$1.toFixed(1)})`, { context: "value" });
|
|
19454
|
+
hashParentListItem.data = parse(`rgb(${Number.parseInt(hex.charAt(0) + hex.charAt(0), 16)},${Number.parseInt(hex.charAt(1) + hex.charAt(1), 16)},${Number.parseInt(hex.charAt(2) + hex.charAt(2), 16)},${(Number.parseInt(hex.charAt(3) + hex.charAt(3), 16) / 255).toFixed(1)})`, { context: "value" });
|
|
19460
19455
|
return;
|
|
19461
19456
|
}
|
|
19462
19457
|
if (hex.length === 5) {
|
|
19463
|
-
|
|
19464
|
-
const g$1 = Number.parseInt(hex.charAt(2) + hex.charAt(2), 16);
|
|
19465
|
-
const b$1 = Number.parseInt(hex.charAt(3) + hex.charAt(3), 16);
|
|
19466
|
-
const a$1 = Number.parseInt(hex.charAt(4) + hex.charAt(4), 16) / 255;
|
|
19467
|
-
hashParentListItem.data = parse(`rgb(${r$1},${g$1},${b$1},${a$1.toFixed(1)})`, { context: "value" });
|
|
19458
|
+
hashParentListItem.data = parse(`rgb(${Number.parseInt(hex.slice(0, 2), 16)},${Number.parseInt(hex.charAt(2) + hex.charAt(2), 16)},${Number.parseInt(hex.charAt(3) + hex.charAt(3), 16)},${(Number.parseInt(hex.charAt(4) + hex.charAt(4), 16) / 255).toFixed(1)})`, { context: "value" });
|
|
19468
19459
|
return;
|
|
19469
19460
|
}
|
|
19470
19461
|
if (hex.length === 6) {
|
|
19471
|
-
|
|
19472
|
-
const g$1 = Number.parseInt(hex.slice(2, 4), 16);
|
|
19473
|
-
const b$1 = Number.parseInt(hex.slice(4, 6), 16);
|
|
19474
|
-
hashParentListItem.data = parse(`rgb(${r$1},${g$1},${b$1})`, { context: "value" });
|
|
19462
|
+
hashParentListItem.data = parse(`rgb(${Number.parseInt(hex.slice(0, 2), 16)},${Number.parseInt(hex.slice(2, 4), 16)},${Number.parseInt(hex.slice(4, 6), 16)})`, { context: "value" });
|
|
19475
19463
|
return;
|
|
19476
19464
|
}
|
|
19477
19465
|
if (hex.length === 7) {
|
|
19478
|
-
|
|
19479
|
-
const g$1 = Number.parseInt(hex.slice(2, 4), 16);
|
|
19480
|
-
const b$1 = Number.parseInt(hex.slice(4, 6), 16);
|
|
19481
|
-
const a$1 = Number.parseInt(hex.charAt(6) + hex.charAt(6), 16) / 255;
|
|
19482
|
-
hashParentListItem.data = parse(`rgb(${r$1},${g$1},${b$1},${a$1.toFixed(1)})`, { context: "value" });
|
|
19466
|
+
hashParentListItem.data = parse(`rgb(${Number.parseInt(hex.slice(0, 2), 16)},${Number.parseInt(hex.slice(2, 4), 16)},${Number.parseInt(hex.slice(4, 6), 16)},${(Number.parseInt(hex.charAt(6) + hex.charAt(6), 16) / 255).toFixed(1)})`, { context: "value" });
|
|
19483
19467
|
return;
|
|
19484
19468
|
}
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19469
|
+
hashParentListItem.data = parse(`rgb(${Number.parseInt(hex.slice(0, 2), 16)},${Number.parseInt(hex.slice(2, 4), 16)},${Number.parseInt(hex.slice(4, 6), 16)},${(Number.parseInt(hex.slice(6, 8), 16) / 255).toFixed(1)})`, { context: "value" });
|
|
19470
|
+
}
|
|
19471
|
+
});
|
|
19472
|
+
walk(declaration, {
|
|
19473
|
+
visit: "Function",
|
|
19474
|
+
enter(func, parentListItem) {
|
|
19475
|
+
if (func.name === "color-mix") {
|
|
19476
|
+
const originalColor = find(func, (node) => node.type === "Function" && node.name === "rgb");
|
|
19477
|
+
const percentage$1 = find(func, (node) => node.type === "Percentage");
|
|
19478
|
+
if (func.children.last?.type === "Identifier" && func.children.last.name === "transparent" && originalColor && percentage$1) {
|
|
19479
|
+
const alpha = Number.parseFloat(percentage$1.value) / 100;
|
|
19480
|
+
originalColor.children.appendData({
|
|
19481
|
+
type: "Operator",
|
|
19482
|
+
value: ","
|
|
19483
|
+
});
|
|
19484
|
+
originalColor.children.appendData({
|
|
19485
|
+
type: "Number",
|
|
19486
|
+
value: alpha.toString()
|
|
19487
|
+
});
|
|
19488
|
+
parentListItem.data = originalColor;
|
|
19489
|
+
}
|
|
19490
|
+
}
|
|
19490
19491
|
}
|
|
19491
19492
|
});
|
|
19492
19493
|
if (declaration.property === "padding-inline") {
|
|
@@ -19552,10 +19553,7 @@ function sanitizeNonInlinableRules(node) {
|
|
|
19552
19553
|
enter(rule) {
|
|
19553
19554
|
if (!isRuleInlinable(rule)) {
|
|
19554
19555
|
walk(rule.prelude, (node$1) => {
|
|
19555
|
-
if (node$1.type === "ClassSelector")
|
|
19556
|
-
const unescapedClassName = decode$1(node$1.name);
|
|
19557
|
-
node$1.name = sanitizeClassName(unescapedClassName);
|
|
19558
|
-
}
|
|
19556
|
+
if (node$1.type === "ClassSelector") node$1.name = sanitizeClassName(decode$1(node$1.name));
|
|
19559
19557
|
});
|
|
19560
19558
|
walk(rule, {
|
|
19561
19559
|
visit: "Declaration",
|
|
@@ -19594,10 +19592,7 @@ function mapReactTree(value, process) {
|
|
|
19594
19592
|
const newProps = { ...node.props };
|
|
19595
19593
|
if (node.props.children && !isComponent(node)) newProps.children = mapReactTree(node.props.children, process);
|
|
19596
19594
|
const processed = process(react.default.cloneElement(node, newProps, newProps.children));
|
|
19597
|
-
if (react.default.isValidElement(processed) && isComponent(processed))
|
|
19598
|
-
const rendered = (typeof processed.type === "object" ? processed.type.render : processed.type)(processed.props);
|
|
19599
|
-
return mapReactTree(rendered, process);
|
|
19600
|
-
}
|
|
19595
|
+
if (react.default.isValidElement(processed) && isComponent(processed)) return mapReactTree((typeof processed.type === "object" ? processed.type.render : processed.type)(processed.props), process);
|
|
19601
19596
|
return processed;
|
|
19602
19597
|
}
|
|
19603
19598
|
return process(node);
|
|
@@ -19612,8 +19607,8 @@ const fromDashCaseToCamelCase = (text) => {
|
|
|
19612
19607
|
};
|
|
19613
19608
|
|
|
19614
19609
|
//#endregion
|
|
19615
|
-
//#region src/utils/compatibility/
|
|
19616
|
-
function
|
|
19610
|
+
//#region src/utils/compatibility/get-react-property.ts
|
|
19611
|
+
function getReactProperty(prop) {
|
|
19617
19612
|
const modifiedProp = prop.toLowerCase();
|
|
19618
19613
|
if (modifiedProp.startsWith("--")) return modifiedProp;
|
|
19619
19614
|
if (modifiedProp.startsWith("-ms-")) return fromDashCaseToCamelCase(modifiedProp.slice(1));
|
|
@@ -19624,12 +19619,41 @@ function convertCssPropertyToReactProperty(prop) {
|
|
|
19624
19619
|
//#region src/utils/css/make-inline-styles-for.ts
|
|
19625
19620
|
function makeInlineStylesFor(inlinableRules) {
|
|
19626
19621
|
const styles = {};
|
|
19622
|
+
const localVariableDeclarations = /* @__PURE__ */ new Set();
|
|
19627
19623
|
for (const rule of inlinableRules) walk(rule, {
|
|
19628
19624
|
visit: "Declaration",
|
|
19629
19625
|
enter(declaration) {
|
|
19630
|
-
|
|
19626
|
+
if (declaration.property.startsWith("--")) localVariableDeclarations.add(declaration);
|
|
19631
19627
|
}
|
|
19632
19628
|
});
|
|
19629
|
+
for (const rule of inlinableRules) {
|
|
19630
|
+
walk(rule, {
|
|
19631
|
+
visit: "Function",
|
|
19632
|
+
enter(func, funcParentListItem) {
|
|
19633
|
+
if (func.name === "var") {
|
|
19634
|
+
let variableName;
|
|
19635
|
+
walk(func, {
|
|
19636
|
+
visit: "Identifier",
|
|
19637
|
+
enter(identifier) {
|
|
19638
|
+
variableName = identifier.name;
|
|
19639
|
+
return this.break;
|
|
19640
|
+
}
|
|
19641
|
+
});
|
|
19642
|
+
if (variableName) {
|
|
19643
|
+
const definition = Array.from(localVariableDeclarations).find((declaration) => variableName === declaration.property);
|
|
19644
|
+
if (definition) funcParentListItem.data = definition.value;
|
|
19645
|
+
}
|
|
19646
|
+
}
|
|
19647
|
+
}
|
|
19648
|
+
});
|
|
19649
|
+
walk(rule, {
|
|
19650
|
+
visit: "Declaration",
|
|
19651
|
+
enter(declaration) {
|
|
19652
|
+
if (declaration.property.startsWith("--")) return;
|
|
19653
|
+
styles[getReactProperty(declaration.property)] = generate(declaration.value) + (declaration.important ? "!important" : "");
|
|
19654
|
+
}
|
|
19655
|
+
});
|
|
19656
|
+
}
|
|
19633
19657
|
return styles;
|
|
19634
19658
|
}
|
|
19635
19659
|
|
|
@@ -21457,7 +21481,7 @@ async function setupTailwind(config) {
|
|
|
21457
21481
|
};
|
|
21458
21482
|
throw new Error(`NO-OP: should we implement support for ${resourceHint}?`);
|
|
21459
21483
|
},
|
|
21460
|
-
polyfills:
|
|
21484
|
+
polyfills: 0,
|
|
21461
21485
|
async loadStylesheet(id, base) {
|
|
21462
21486
|
if (id === "tailwindcss") return {
|
|
21463
21487
|
base,
|
|
@@ -21495,7 +21519,7 @@ async function setupTailwind(config) {
|
|
|
21495
21519
|
|
|
21496
21520
|
//#endregion
|
|
21497
21521
|
//#region src/tailwind.tsx
|
|
21498
|
-
const pixelBasedPreset = { theme: {
|
|
21522
|
+
const pixelBasedPreset = { theme: { extend: {
|
|
21499
21523
|
fontSize: {
|
|
21500
21524
|
xs: ["12px", { lineHeight: "16px" }],
|
|
21501
21525
|
sm: ["14px", { lineHeight: "20px" }],
|
|
@@ -21548,7 +21572,7 @@ const pixelBasedPreset = { theme: {
|
|
|
21548
21572
|
80: "320px",
|
|
21549
21573
|
96: "384px"
|
|
21550
21574
|
}
|
|
21551
|
-
} };
|
|
21575
|
+
} } };
|
|
21552
21576
|
function Tailwind({ children, config }) {
|
|
21553
21577
|
const tailwindSetup = useSuspensedPromise(() => setupTailwind(config ?? {}), JSON.stringify(config));
|
|
21554
21578
|
let classesUsed = [];
|