Injecting CSS in PrimeVue 4 Custom Preset with Nuxt Module Not Working? #3205
Unanswered
tonwiebsci
asked this question in
PrimeVue
Replies: 1 comment
-
Added more details, seems like same preset works as expected on vue standalone but it does not fully work on nuxt-module |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are trying to create our Preset for PrimeVue 4
We are attempting to create a custom Preset for PrimeVue 4 as demonstrated in this video. While overriding tokens seems to work correctly, we're having trouble injecting CSS styles via the preset when using the @primevue/nuxt-module.
Our Preset:
Nuxt Configuration:
Behavior:
button.padding.x
) works perfectly, so the preset is being applied at some level.body { display: none !important; }
and.p-button.p-button-custom { color: red; }
do not show up in the final CSS.severity="custom"
on a button<Button type="submit" severity="custom" label="Custom" />
does add the correct classp-button-custom
to the DOM, but the corresponding CSS rules are missing.css
at the root level and undercomponents.button
, as shown in the video, but no difference.Initially, we aimed to use token values via
${dt('primary.50')}
, but even with hardcoded colors the CSS isn't injected.Minimal Reproduction: We created a minimal Nuxt StackBlitz example demonstrating the issue.
Question: Is there something special we need to do when using a custom preset with the
@primevue/nuxt-module
to inject CSS? Are we missing a configuration step, or is the Nuxt module not currently supporting CSS injection fromdefinePreset
as shown in the video?-EDIT-
Same preset does inject the styles from the
css
property in a standalone vue application. Vue StackBlitz ExampleAnd I can see both: root level and
component.button
level, does that mean that there might be an issue with the PrimeVue nuxt module? or with nuxt?
We appreciate any insights or guidance on what might be going wrong. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions