Skip to content

undefined and false in css variables in inline styles are not removed  #5322

Closed
@hit12369

Description

@hit12369

Version

3.2.29

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Use :style="{'--var': undefined}" or :style="{'--var': false}" in a template.

It's rendered as style="--var: undefined" or style="--var: false" which seems incorrect, --var should be removed instead. Using null works correctly and --var is removed.

What is expected?

Inline css variable should be removed.

What is actually happening?

It's actually being rendered as undefined.

Metadata

Metadata

Assignees

Labels

🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.🐞 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions