Skip to content

Allow css variable in style binding (object syntax) #4017

@vbrajon

Description

@vbrajon

I am not sure if this is intentional, I would like to be able to do:

<div :style="{ '--color': player.color }">…</div>

instead of:

<div :style="'--color :' + player.color">…</div>

I was able to find the workaround quickly thanks to the doc search here: http://vuejs.org/guide/migration.html#v-bind-style-with-Object-Syntax-and-important-deprecated

It's a bit different from !important so I would like to push for this feature.

Thanks a lot for your good work, I can work on a PR if you agree with this proposition.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions