Skip to content

Vue autofix breaks inline CSS custom properties in style attribute #840

@TiroZit

Description

@TiroZit

Describe the bug

When using an inline CSS custom property inside a Vue template, autofix rewrites the style attribute into broken formatting.

This happens with a simple inline custom property such as --color: #000.

Reproduction

Minimal example:

<template>
  <div class="box" style="--color: #000">
    Hello
  </div>
</template>

After autofix, it becomes:

<template>
  <div
    class="box" style="

--color: #000"
  >
    Hello
  </div>
</template>

System Info

System:
  OS: macOS v26.4

Binaries:
  Node: v22.21.1
  npm: v10.9.4

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions