Currently tackling a VueJS 2 project and facing issues with scoped styling when cleaning up the code.
My setup involves 3 components that share similarities, prompting me to utilize mixins for consolidating the code into one file. Each component makes use of these mixins for both template and vuejs functionalities. If I need to tweak specific conditions for a particular component, I can easily override the code within it, which is functioning smoothly so far.
However, my aim now is to transfer the scoped style to the mixins as well. Currently, the style is enclosed in
<style lang="scss" scoped></style>
tag, working effectively within its respective component but necessitating duplication of styling codes across all 3 components.
I could opt to include these styles in the global CSS file, but restricting them to only one of the 3 components poses a challenge.
Is there a method to incorporate these styles and apply them to mixins?
What approach would be considered best practice for addressing this scenario?