M
M
Maxim Zolotoy2020-08-02 17:33:53
JavaScript
Maxim Zolotoy, 2020-08-02 17:33:53

How to pass scss variables to vue plugin?

Here I made, for example, a separate plugin for vue with UI components. And these components internally use scss variables from the variables.scss file in this plugin.

When I use this plugin in another project, how can I arrange to pass my variables.scss file to the plugin to overwrite variables?

I looked at the documentation and how others do it in their packages like vuetify but did not find it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
profesor08, 2020-08-02
@profesor08

Bad idea. Components don't play well with this approach. So by themselves they should be self-sufficient. And so it turns out that all self-sufficiency flies into the pipe. Use themes and communicate them through props, with colors if needed, etc.

A
Alex Glebov, 2020-08-02
@SkiperX

Use the default variables in the plugin, they can be copied to the project and overridden
https://sass-scss.ru/documentation/sassscript/re...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question