Skip to content

Feature request: passing colors as CSS variablesΒ #22

@joelmukuthu

Description

@joelmukuthu

Hi, thanks for this wonderful module!

I'm no expert on how colors work with SVGs but was wondering if it would be possible to support passing colors as CSS variables? The following snippet fails with a JavaScript error:

<ProgressBar
  style="radial"
  series="{[
    {
      perc: 10,
      color: 'var(--my-color)',
    },
  ]}"
  thickness="{6}"
  textSize="{140}"
/>

<style>
  :global(:root) {
    --my-color: red;
  }
</style>

Error:

Uncaught TypeError: Cannot read property 'slice' of null

Unfortunately I don't have a stack trace (development environment issues).

Let me know if there's any more info you'd need.

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