Skip to content

Css variable definitions outside svg #2853

@janpe

Description

@janpe

Description

Css variables don't seem to work if defined outside the css element. I have a case where I receive svg data and want to prepend some css variables to that string. This use case should be valid as it works in the browser.

Also there does not seem to be documentation on this feature.

Steps to reproduce

  1. Go to https://snack.expo.dev/kVoKWoPI8MAlGNaUXM2md
  2. Update react-native-svg to 15.8.0 or newer
  3. Move style tag one line up, outside the svg element
  4. Launch Snack on Android or iOS
  5. The rectangle is not red

Snack or a link to a repository

https://snack.expo.dev/kVoKWoPI8MAlGNaUXM2md

SVG version

15.12.1

React Native version

0.81.0

Platforms

iOS, Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

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