Presets not merging #1014
-
DescriptionThanks for this project, I love the idea and trying to use it in a pure TS monorepo (no intermediate bundling)... Before being able to do this, I'm gonna need the type safety provided by using several presets from multiple packages, but I couldn't find a way to do it as the presets doesn't seem to merge... When I use two presets in the Is there something I'm missing here? Link to Reproductionhttps://github.com/lalexdotcom/panda-presets Steps to reproduceCouldn't set it to stackblitz, the repo is a devcontainer for VSCode
5 use cases are tested:
JS FrameworkNot here yet (TS) Panda CSS Version0.6.0 BrowserNo response Operating System
Additional InformationMy environment is a devcontainer (linux) with a macOS host... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@lalexdotcom I don't fully understand your issue, but one correction in your codebase, is that the presets should use the extend keyword presets: [
definePreset({
theme: {
extend:{
tokens: {
colors: { 'test.light': { value: '#112233' } }
}
}
}
}),
definePreset({
theme: {
extend:{
tokens: {
colors: { 'test.dark': { value: '#112233' } },
sizes: { '3xs': { value: '1px' } }
}
}
}
})], |
Beta Was this translation helpful? Give feedback.
-
Yey, you got it! I totally didn't see the I find that the subtle difference between theme and preset is a bit confusing... Maybe there would be something to investigate here for a better DX (which is already the best I tried for many other aspects): maybe be a In presets that can take an array, it can be confusing that an array element can cancel all the previous ones... I don't have any clear answer for that, but maybe there's a way to make things more intuitive? Thanks so much for your quick answer so I can go with panda! |
Beta Was this translation helpful? Give feedback.
@lalexdotcom I don't fully understand your issue, but one correction in your codebase, is that the presets should use the extend keyword
for https://github.com/lalexdotcom/panda-presets/blob/d9f6ee07803bedb3c76259e2dc90e5087d5ab5f8/panda.config-with-two-presets.ts#L19