B
B
Bronewi4ok2020-08-24 03:28:12
Layout
Bronewi4ok, 2020-08-24 03:28:12

Replacing variable value with variable name in scss with gulp?

How can I automate the following process in .scss using gulp:

$white_color: #ffffff;
.foo {
    color: #ffffff;
}

so that the output automatically changes to
$white_color: #ffffff;
.foo {
    color: $white_color;
}

Those. all matches of the variable value were replaced with the variable name in the scss files. The plugin for VS Code does something similar, but it only works with colors, and, for example, it can no longer be applied to font variables:
https://marketplace.visualstudio.com/items?itemNam...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question