We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0bc1a1 commit 0b0a459Copy full SHA for 0b0a459
1 file changed
packages/layerchart/src/lib/utils/canvas.ts
@@ -82,8 +82,14 @@ function render(
82
83
// TODO: Consider memoizing? How about reactiving to CSS variable changes (light/dark mode toggle)
84
let resolvedStyles: StyleOptions;
85
- if (styleOptions.classes == null) {
86
- // Skip resolving styles if no classes are provided
+ if (
+ styleOptions.classes == null &&
87
+ !Object.values(styleOptions.styles ?? {}).some(
88
+ (v) => typeof v === 'string' && v.includes('var(')
89
+ )
90
+ ) {
91
+ // Skip resolving styles if no classes are provided and no styles are using CSS variables
92
+ // TODO: Convert colors using `rgb(0 0 0 / 50%)` to `rgba(0, 0, 0, 0.5)`
93
resolvedStyles = styleOptions.styles ?? {};
94
} else {
95
const computedStyles = getComputedStyles(ctx.canvas, styleOptions);
0 commit comments