Skip to content

Commit

Permalink
support both directory style in tailwind recipe (#4137)
Browse files Browse the repository at this point in the history
Co-authored-by: Siddharth Suresh <[email protected]>
  • Loading branch information
GHKEN and siddhsuresh committed May 11, 2023
1 parent 5a64f1c commit 89446b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-numbers-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blitzjs/recipe-tailwind": minor
---

support both directory style in tailwind recipe
7 changes: 5 additions & 2 deletions recipes/tailwind/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default RecipeBuilder()
stepId: "addStyles",
stepName: "Stylesheet",
explanation: `Adds a root CSS stylesheet where Tailwind is imported and where you can add global styles`,
targetDirectory: "./app/core",
targetDirectory: `./${paths.appSrcDirectory()}/core`,
templatePath: join(__dirname, "templates", "styles"),
templateValues: {},
})
Expand All @@ -39,7 +39,10 @@ export default RecipeBuilder()
explanation: `Imports the stylesheet we just added into your app`,
singleFileSearch: paths.app(),
transform(program) {
const stylesImport = j.importDeclaration([], j.literal("app/core/styles/index.css"))
const stylesImport = j.importDeclaration(
[],
j.literal(`${paths.appSrcDirectory()}/core/styles/index.css`),
)
return addImport(program, stylesImport)
},
})
Expand Down

0 comments on commit 89446b3

Please sign in to comment.