Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function compile(code: Buffer | string, options: CompilerOptions = {}) {
const css = typeof code === "string" ? code : code.toString();
const match = css.match(/:root\s*\{[^}]*font-size:\s*([\d.]+)px/);
effectiveRem = match?.[1] ? parseFloat(match[1]) : 14;
options.inlineRem = effectiveRem;
}
Comment thread
maxencehenneron marked this conversation as resolved.

const firstPassVisitor: Visitor<CustomAtRules> = {};
Expand Down
10 changes: 5 additions & 5 deletions src/metro/metro-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const worker =
require(unstable_transformerPath) as typeof import("metro-transform-worker");

export async function transform(
config: JsTransformerConfig,
config: JsTransformerConfig & {
reactNativeCSS?: CompilerOptions | undefined;
},
projectRoot: string,
filePath: string,
data: Buffer,
options: JsTransformOptions & {
reactNativeCSS?: CompilerOptions | undefined;
},
options: JsTransformOptions,
): Promise<TransformResponse> {
const isCss = options.type !== "asset" && /\.(s?css|sass)$/.test(filePath);

Expand All @@ -37,7 +37,7 @@ export async function transform(
const css = cssFile.output[0].data.css.code.toString();

const productionJS = compile(css, {
...options.reactNativeCSS,
...config.reactNativeCSS,
filename: filePath,
projectRoot: projectRoot,
}).stylesheet();
Expand Down
Loading