There is a documented example to inject css when using the Primevue v4 preset.
The documentation example does not work, and I suspect that there is an error in the documentation.
In the extends documentation at the global preset level
The position of the css property seems wrong in the example.
const MyPreset = definePreset(Lara, {
components: {
tag: {
// inside a component itself, works 🎉
css: ({ dt }) => ``,
},
// inside the `components:` at the same level of other components like seen in the theme `extend` documentation section ❌
css: ({ dt }) => `
.p-toggleswitch.p-disabled .p-toggleswitch-slider {
opacity: ${dt('toggleswitch.my.disabled.opacity')};
}
.p-toggleswitch.p-disabled .p-toggleswitch-handle {
background: ${dt('toggleswitch.my.checked.disabled.background')};
}
`
}
});
2.
On the other hand, when i place the css property within the tag or button object itself, it works
The css property has to be within the component itself.- material theme working example at an atomic component preset level.
3.
On the root position of the theme object it seems to work, see material theme root declaration. But it's empty so it's unclear.
Describe the bug
There is a documented example to inject css when using the Primevue v4 preset. The documentation example does not work, and I suspect that there is an error in the documentation.
2. On the other hand, when i place the css property within the
tag
orbutton
object itself, it worksThe css property has to be within the component itself.- material theme working example at an atomic component preset level.
3. On the root position of the theme object it seems to work, see material theme root declaration. But it's empty so it's unclear.
Reproduction
a simple reproduction
Proposition
Reproducer
https://github.com/primefaces/primevue/blob/aec47f4fcb4748f7bd36fe8efa16342c453de3a0/packages/themes/src/presets/material/index.js#L185
PrimeVue version
4.2.2
Vue version
4.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior