Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion example/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css";
@import "tailwindcss/utilities.css";

@theme {
--text-xs--line-height: calc(1em / 0.75);
--text-sm--line-height: calc(1.25em / 0.875);
--text-base--line-height: calc(1.5em / 1);
--text-lg--line-height: calc(1.75em / 1.125);
--text-xl--line-height: calc(1.75em / 1.25);
--text-2xl--line-height: calc(2em / 1.5);
--text-3xl--line-height: calc(2.25em / 1.875);
--text-4xl--line-height: calc(2.5em / 2.25);

--leading-tight: 1.25em;
--leading-snug: 1.375em;
--leading-normal: 1.5em;
--leading-relaxed: 1.625em;
--leading-loose: 2em;
}
4 changes: 1 addition & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ export default function App() {
return (
<>
<View className="justify-center items-center h-full">
<Text className="text-green-500 ring-2 ring-blue-500 shadow-xl shadow-red-500">
Test Component
</Text>
<Text className="text-red-500">Test Component</Text>
</View>
</>
);
Expand Down
15 changes: 9 additions & 6 deletions src/compiler/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const propertyRename: Record<string, string> = {
"background-image": "experimental_backgroundImage",
};

const needsRuntimeParsing = new Set([
const unparsedRuntimeParsing = new Set([
"animation",
"text-shadow",
"transform",
Expand Down Expand Up @@ -811,7 +811,7 @@ export function parseDeclarationUnparsed(
/**
* Unparsed shorthand properties need to be parsed at runtime
*/
if (needsRuntimeParsing.has(property)) {
if (unparsedRuntimeParsing.has(property)) {
const args = parseUnparsed(declaration.value.value, builder);

if (property === "animation") {
Expand All @@ -829,10 +829,13 @@ export function parseDeclarationUnparsed(
]);
}
} else {
builder.addDescriptor(
property,
parseUnparsed(declaration.value.value, builder),
);
const value = parseUnparsed(declaration.value.value, builder);

builder.addDescriptor(property, value);

if (property === "font-size") {
builder.addDescriptor("--__rn-css-em", value);
}
}
}

Expand Down