Is there a reason styles are not scoped in the components? I think this is fine for 99% of people using PrimeVue, but I think this could cause issues for companies with a microfrontend architecture because micro frontends could have a different version of primevue and the styles from a micro frontend could affect the other.
Example of what it is right now:
<style>
.p-autocomplete {
display: inline-flex;
position: relative;
}
</style>
Example of what I think it should be:
<style scoped>
.p-autocomplete {
display: inline-flex;
position: relative;
}
</style>
Deep selector can be used to affect the styles of child components.
Scoping styles inside components
-
- Posts: 560
- Joined: 23 Oct 2020, 09:28
I agree. It possible for all libraries not just PrimeVue. As you could see in the docs, there is `appendTo` property and the default value is 'body'. Scope styling wont' be the ultimate solution.
-
- Posts: 560
- Joined: 23 Oct 2020, 09:28
Thanks for the great explanation. It would be very useful for the community.
We're open the new ideas to add some styles for components that appended the body.
We're open the new ideas to add some styles for components that appended the body.
-
- Posts: 560
- Joined: 23 Oct 2020, 09:28
There is a new 'pt' property for this purpose. For example: https://primevue.org/sidebar/#pt.demo
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests