Replies: 5 comments 3 replies
-
Hey @segunadebayo, so I know for future - what should be a bug and what should be a discussion? FWIW I've gone a bit further and it appears the same issue happens for But is missing some styles when run in storybook ( |
Beta Was this translation helpful? Give feedback.
-
FWIW they work in a regular next/storybook context: |
Beta Was this translation helpful? Give feedback.
-
Alright, I've been able to solve this thanks to @thetiby here: #943 (comment)
export default defineConfig({
include:
process.env.NX_TASK_TARGET_TARGET === 'storybook'
? ['./apps/**/*.{ts,tsx}', './libs/**/*.{ts,tsx}']
: ['../../apps/**/*.{ts,tsx}', '../../libs/**/*.{ts,tsx}'],
outdir:
process.env.NX_TASK_TARGET_TARGET === 'storybook'
? './libs/styled-system/src/__generated__'
: '../../libs/styled-system/src/__generated__',
// modify this to add to the theme
theme: { ... },
...
});
module.exports = {
plugins: {
'@pandacss/postcss': {
configPath:
process.env.NX_TASK_TARGET_TARGET === 'storybook'
? './libs/styled-system/panda.config.ts'
: '../../libs/styled-system/panda.config.ts',
},
},
};
Note: storybook and next.js seem to run with a different working directory in |
Beta Was this translation helpful? Give feedback.
-
I'm using this in a monorepo but currently haven't moved the styled system into its own package yet. Does anybody have a solution for this scenario? |
Beta Was this translation helpful? Give feedback.
-
Thought I'd share my panda.config.mjs here as we found that there's a couple of things I found that make life easier.
import { defineConfig } from '@pandacss/dev';
import { workspaceRoot } from 'nx/src/utils/workspace-root';
import path from 'path';
export default defineConfig({
include: [path.join(workspaceRoot, './apps/appName/src/**/*.{js,jsx,ts,tsx}')],
importMap: '@local/styled-system',
outdir: '@local/styled-system',
emitPackage: true,
}); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm using
nx
to manage my project with an "integrated" setup (i.e. using @nx/next). I've got it set up so that;apps/my-app
libs/theme
and imported into theapps/my-app/panda.config.ts
via@nx-integrated-monorepo/theme
.libs/styled-system/src/__generated__/*
and exported via@nx-integrated-monorepo/styled-system
.This works as expected for recipes and tokens, but not semantic tokens.
Here's my panda.config.ts:
This mostly works as expected - I can see tokens I've created via
defineTokens
in the output CSS, but the semantic tokens are not outputting (regardless of whether I inline them here or define them in the theme lib).Link to Reproduction
Codesandbox
Steps to reproduce
libs/styled-system/src/__generated__tokens/index.css
for missingheavy
semantic tokenJS Framework
React, TS, next.js, storybook, nx (🥲)
Panda CSS Version
0.6.0
Browser
No response
Operating System
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions