discourse/plugins/poll/test/javascripts/unit
Kris 2b08a3e745
FEATURE: allow pie chart colors to be overridden with CSS (#36495)
This introduces the ability to customize the colors used within pie
charts for polls. Admins and theme developers can now override the
colors using CSS custom properties. I've also added specific properties
to make targeting bar charts a little simpler too.

If only some pie chart colors are overridden, we fall back to our
default color gradients.

Here's an example

```css
:root {
  --poll-pie-color-1: red;
  --poll-pie-color-2: yellow;
        
  --poll-bar-background: lightblue;
  --poll-bar-color: blue;
  --poll-bar-color--chosen: salmon;
}
```

<img width="1446" height="794" alt="image"
src="https://github.com/user-attachments/assets/d5a4731d-b7eb-4069-9a0d-c35c9e56518b"
/>

<img width="1424" height="766" alt="image"
src="https://github.com/user-attachments/assets/b30d337e-f714-499b-b48f-ecb9e6e728d7"
/>


Included a test for the pie chart colors.
2025-12-05 16:51:26 -05:00
..
chart-colors-test.js FEATURE: allow pie chart colors to be overridden with CSS (#36495) 2025-12-05 16:51:26 -05:00