Skip to content

Commit

Permalink
feat: support formatting css v-bind
Browse files Browse the repository at this point in the history
close #2105
  • Loading branch information
johnsoncodehk committed Dec 18, 2022
1 parent 88b0d98 commit b27556c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vue-language-tools/vue-language-core/src/plugins/vue-tsx.ts
Expand Up @@ -138,6 +138,20 @@ const plugin: VueLanguagePlugin = ({ modules, vueCompilerOptions, compilerOption
if (htmlGen.value) {
embeddedFile.content = [...htmlGen.value.formatCodeGen];
}

for (const cssVar of cssVars.value) {
embeddedFile.content.push('\n\n');
for (const range of cssVar.ranges) {
embeddedFile.content.push('(');
embeddedFile.content.push([
cssVar.style.content.substring(range.start, range.end),
cssVar.style.name,
range.start,
{},
]);
embeddedFile.content.push(');\n');
}
}
}
else if (suffix.match(/^\.__VLS_template_style\.css$/)) {

Expand Down

0 comments on commit b27556c

Please sign in to comment.