IsraelDCastro / my-library-vue-ts

24 stars 19 forks source link

How to import css style beside component? #2

Closed gleissonneves closed 8 months ago

gleissonneves commented 1 year ago

Case: I am using a component exported from my library, but when using it, the style is not persisted

Example: it turns out that it shows the unstyled component; Captura de tela de 2023-01-19 02-16-58

When to show style Captura de tela de 2023-01-19 02-20-05

gleissonneves commented 1 year ago

Use vite-plugin-css-injected-by-js inject CSS in component

Correction step by step

Install vite-plugin-css-injected-by-js; In file vite.config.ts adding: plugins: [ ... cssInjectedByJsPlugin() ... ]

IsraelDCastro commented 8 months ago

Thank you for the suggestions, I'll check the PR and try it on.