mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 23:30:21 +08:00
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.
|
||
|---|---|---|
| .. | ||
| chart-colors-test.js | ||