Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler-sfc): duplicated injected css var with repeated vars #2802

Conversation

patak-dev
Copy link
Member

When the same css var was used multiple times in <style>, that var was injected several times in the <script>

For the added test case it was generating

_useCssVars(_ctx => ({
  "xxxxxxxx-color": (color),
  "xxxxxxxx-color": (color)
}))

This PR removes duplicated vars in parseCssVars so we get

_useCssVars(_ctx => ({
  "xxxxxxxx-color": (color)
}))

@HcySunYang HcySunYang added the 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. label Mar 29, 2021
@yyx990803 yyx990803 merged commit 2901050 into vuejs:master Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: sfc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants