Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel committed Jan 29, 2025
1 parent 89cce13 commit d904879
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/cli/src/lib/setups/css/replacers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function replaceRootLinks(
importNodes.shift();

const layoutStyleNode = root.find({
rule:{
rule: {
kind: 'jsx_element',
regex: 'resetStyles',
has: {
Expand All @@ -70,11 +70,14 @@ export async function replaceRootLinks(
const layoutStyleNodeContent = layoutStyleNode.text();
const newLinkNode = importer.isConditional
? `{${importer.name} && <link rel="stylesheet" href={${importer.name}}></link>}`
: `<link rel="stylesheet" href={${importer.name}}></link>`
: `<link rel="stylesheet" href={${importer.name}}></link>`;

return content
.replace(lastImportContent, lastImportContent + '\n' + importStatement)
.replace(layoutStyleNodeContent, newLinkNode + '\n' + layoutStyleNodeContent);
.replace(
layoutStyleNodeContent,
newLinkNode + '\n' + layoutStyleNodeContent,
);
});
}

Expand Down

0 comments on commit d904879

Please sign in to comment.