@primeuix/themes v3.0.0: Presets not working anymore #4861
|
Until now, my preset looked like the following. However, since the upgrade to v3, two issues have occurred. First, my |
Replies: 3 comments 4 replies
|
Hi, Thanks for reporting the issue, we'll check it. |
|
Hi! Looking at your code snippet and the TypeScript error (TS2322), this issue happens because in @primeuix/themes v3 the type signatures for css functions and the dt helper were refined to be much stricter. Additionally, the secondary semantic token is no longer resolved directly at the root of the semantic object in certain preset structures without proper token extension. To bypass the TypeScript error immediately without removing your custom css functions, you can remove the explicit strict type annotations and let TypeScript infer the correct context types:
drawer: {
If anyone found a clean way to type dt in v3 without resorting to //@ts-ignore, feel free to share! |
|
Hi, Fixed now. Typing the preset You can also use |
Hi,
Fixed now. Typing the preset
cssas a function is covered in the primeuix/styled 1.1.0 and themes 3.0.2 post: https://blog.primeui.dev/blog/primeuix-styled-1-1-0-and-themes-3-0-2/#typing-a-function-as-preset-cssYou can also use
dtinside a plain string, without wrapping it in a function. There is an example in the design tokens post: https://blog.primeui.dev/blog/design-tokens-in-primeui/#css-in-the-preset