Skip to content

[Feature] 动态主题切换需求,实现思路(CSS var)(已另寻他法解决) #18716

@adoin

Description

@adoin

What problem does this feature solve?

参考了一众的issue,知道主题切换有一些问题。
在这里提供一个思路也希望能有这方面的实践。
svg模式下可以用css的变量来填充颜色i.o. fill="var(--primry-1-color)"。
canvas模式下只能:getComputedStyle(context.canvas).getPropertyValue("--primry-1-color"),而后进行后续绘制
如此可把主题文件css化,打通layer渲染和canvas/svg渲染。
从而实现如主题切换、局部状态改变之类的需求

What does the proposed API look like?

如上

Metadata

Metadata

Assignees

No one assigned

    Labels

    not-relatedThis is not related directly to ECharts.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions