I’m working on custom Vue components which I wan’t to share between my projects (things like buttons, inputs form and so). They would be shared as npm package, but instead of npm hosting I’m using private github repository.
I would like to create it with typescript, with possibility to inject custom styles (like button color and so) based on scss variables. Is this possible to achieve ? Or maybe there is different/better approach?
The main problem I’m facing is during installation of my library: all button use default values of styles, completly ignoring globall scss variables from main project. How can I solve this ?
Well, the only way to solve this, Typescript or not, is to write our scss in separate
.scss files that the user can then import into their project and compile to css themselves:
Component Frameworks like Vuetify do it as well:
Thanks, that solves my issue