Skip to content

Commit 3bbda9c

Browse files
committed
refactor(splitting): recipe index
1 parent b3adc6c commit 3bbda9c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/generator/src/generator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface SplitCssResult {
2727
recipes: SplitCssArtifact[]
2828
/** Theme CSS files (not auto-imported) */
2929
themes: SplitCssArtifact[]
30-
/** Content for recipes/index.css */
30+
/** Content for recipes.css */
3131
recipesIndex: string
3232
/** Content for main styles.css */
3333
index: string
@@ -173,8 +173,8 @@ export class Generator extends Context {
173173
}
174174
}
175175

176-
// Build recipes/index.css content
177-
const recipesIndex = recipes.map((r) => `@import './${r.file}';`).join('\n')
176+
// Build recipes.css content
177+
const recipesIndex = recipes.map((r) => `@import './recipes/${r.file}';`).join('\n')
178178

179179
// Build main styles.css content
180180
const layerOrder = [layerNames.reset, layerNames.base, layerNames.tokens, layerNames.recipes, layerNames.utilities]
@@ -184,7 +184,7 @@ export class Generator extends Context {
184184
imports.push(`@import './styles/${layer.file}';`)
185185
}
186186
if (recipes.length) {
187-
imports.push(`@import './styles/recipes/index.css';`)
187+
imports.push(`@import './styles/recipes.css';`)
188188
}
189189

190190
return {

packages/node/src/create-context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ export class PandaContext extends Generator {
146146

147147
// Recipes index
148148
if (artifacts.recipes.length) {
149-
styleFiles.push({ file: `${artifacts.recipes[0].dir}/index.css`, code: artifacts.recipesIndex })
150-
logger.info('css', pathUtil.join(...stylesDir, artifacts.recipes[0].dir!, 'index.css'))
149+
styleFiles.push({ file: 'recipes.css', code: artifacts.recipesIndex })
150+
logger.info('css', pathUtil.join(...stylesDir, 'recipes.css'))
151151
}
152152

153153
// Theme files

0 commit comments

Comments
 (0)