EranGrin / vue-web-component-wrapper

vue3 - web component wrapper plugin
https://erangrin.github.io/vue-web-component-wrapper/
50 stars 5 forks source link

Prepending allows for sud-derived components styles to cascade further #26

Closed OllyNicholass closed 1 month ago

OllyNicholass commented 1 month ago

https://github.com/EranGrin/vue-web-component-wrapper/blob/3063fa4ca8f36e3146b16fd5dcfcd4baf3ac9a7d/package/src/web-component-util.js#L63C40-L63C47

Using the append function should allow styles to be injected in the correct cascading order

e.g.

<IconButton/> component is made up of: -> <Icon/> -> <Button/>

Prepending the styles:

<style>IconButton</style>
<style>Button</style>
<style>Icon</style>

Appending the styles:

<style>Icon</style>
<style>Button</style>
<style>IconButton</style>

Allowing for IconButton styles to be the most relevant in terms of specificity.

EranGrin commented 1 month ago

It seems like the right order now 😃

EranGrin commented 1 month ago

New version 1.6.2 is released and published on npm Closing this issue

@OllyNicholass You're most welcome to open a new issue if you find any or have any improvement suggestions.

EranGrin commented 1 month ago

Hi @OllyNicholass I just had a second thought regarding these changes, from a performance point of view, append will always be faster as prepend needs to shift the entire stuck. This might be so minor, but we should still consider this. Do you think we should benchmark large applications to evaluate efficiency?

EranGrin commented 1 month ago

Closing the ticket