EranGrin / vue-web-component-wrapper

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

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

Closed OllyNicholass closed 4 months ago

OllyNicholass commented 4 months 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 4 months ago

It seems like the right order now 😃

EranGrin commented 4 months 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 4 months 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 4 months ago

Closing the ticket