qmhc / grid-layout-plus

A draggable and resizable grid layout, for Vue 3.
https://grid-layout-plus.netlify.app/
MIT License
325 stars 40 forks source link

style cannot be post-processed #26

Open kingyue737 opened 6 months ago

kingyue737 commented 6 months ago

CSS in this project is injected by js via vite-plugin-css-injected-by-js, and thus it cannot be post-processed by PostCSS or lightningCSS on the user end.

For example, this project injects prefixes that may not be needed by users targeting the latest browsers. If the styles can be post-processed on the user end, those unnecessary styles will be removed by PostCSS to reduce bundle size.

On the other hand, this project uses some features that are not supported on old browsers like inset and percentage in opacity, both of which have a global usage of less than 95% https://caniuse.com/mdn-css_properties_inset. The users that target older browsers will need PostCSS to transpile them.

As a library, I think it would be better to build styles into a .css dist file instead of a js string.