highcharts / highcharts

Highcharts JS, the JavaScript charting framework
https://www.highcharts.com
Other
11.87k stars 3.54k forks source link

Exporting: Styled mode CSS variables are lost #21142

Closed wjaspers closed 1 month ago

wjaspers commented 1 month ago

Expected behaviour

When exporting a chart whose style choices are utilizing CSS variables, the variable values should be used.

Actual behaviour

Exporting a chart with CSS variables yields invalid values, which turn black.

Live demo with steps to reproduce

https://jsfiddle.net/bru0dm7q/1/

Example code

/* styles */
:root {
  --hc-color-0: #FF0000;
}
// chart options
  "series": [{
      "data": [{
        "x": 1,
        "y": 9,
        "name": "Point2",
        "color": "var(--hc-color-0)"
      }],
      "type": "column"
    },

Product version

Highcharts 11.4.1

Affected browser(s)

Chrome, Chromium 124.0

not tested on Safari or Edge

Attached exported screenshot

As shown to the user browser-view

As exported styled-mode-color-loss

hubertkozik commented 1 month ago

Closing as duplicate of https://github.com/highcharts/highcharts/issues/16400.