Skip to content

Multiple CSS variables as inline style #312

@ArthurGoupil

Description

@ArthurGoupil

Hi !

I have an svg that takes variables as inline style as follow:

<svg
 style={{ height: size, width: size, fill: iconColor }}
/>

where each variable end up being a CSS variable.

The fill variable is well taken into consideration by jest-preview, but not the width/height 🤔 . When I hardcode values for height/width, it works.

I've checked and the CSS variable exist in the preview and follow the exact same structure than for fill.

Screenshots

Capture d’écran 2024-02-01 à 01 14 49

Reproduce

https://stackblitz.com/edit/jest-preview-yegte5?file=src%2FApp.tsx
The CSS variables on the test div are not taken into account

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions