TradingView 中文开发文档
  • 序言
  • 更新日志
  • 1、Charting Library 是什么
  • 2、入门指南
    • 2-1、图表库内容
    • 2-2、运行图表库
  • 3、数据绑定
    • 3-1、如何连接我的数据
    • 3-2、JS Api
    • 3-3、UDF
    • 3-4、Symbology
    • 3-5、交易时段
    • 3-6、报价
  • 4、图表定制
    • 4-1、定制概述
    • 4-2、Widget 构造器
    • 4-3、Widget 方法
    • 4-4、图表方法
    • 4-5、功能集
    • 4-6、服务端定制
    • 4-7、定制的使用案例
  • 5、交易终端
    • 5-1、交易终端简介
    • 5-2、经纪商 API
    • 5-3、交易主机
    • 5-4、账户管理器
    • 5-5、交易对象和常量
  • 6、储存和载入图表
  • 6-1、储存和载入的内存示例
  • 7、创建自定义指标
  • 8、最佳实践
  • 9、经常被问到的问题
  • 10、版本变更点
  • 附录
    • 图表的主要组成
    • 周期
    • 时间范围
    • 本地化
    • 覆盖
    • 绘图覆盖
    • 指标覆盖
    • 形状与覆盖
    • 图表样式属性
    • 图表自定义
    • 工具栏自定义
    • CSS主题颜色
    • 订阅
    • 交易元语
    • 在 K 线上做标记
    • 委托
    • WatchedValue
    • 指标 API
    • 形状 API
    • 形状组 API
    • 选择 API
    • 窗格 API
    • 数据列 API
    • 价格刻度 Api
    • 窗格和刻度特性
    • 快捷键
    • 新闻API示例
由 GitBook 提供支持
在本页

这有帮助吗?

  1. 附录

CSS主题颜色

上一页工具栏自定义下一页订阅

最后更新于5年前

这有帮助吗?

不再支持Internet Explorer 11浏览器。 使用此特定的Web浏览器时,本节中描述的功能不会影响界面。

重要提示:目前正在开发此功能。在以后的版本中,可能完全更改或删除任何变量和选择器名称。

从版本1.16开始.

You can change the colors of light/dark theme for certain UI elements by connecting your . For your convenience, some elements have CSS Custom Properties that can be overridden.

您可以通过使用CSS文件来更改某些UI元素的light/dark主题的颜色。为了您的方便,某些元素具有可以覆盖的CSS自定义属性。

The following CSS will make the widget look pink when selecting the light/dark theme. 当选择light/dark主题时,以下CSS将使widget呈显出粉红色。

:root:not(.theme-dark) {
    --tv-color-platform-background: #d1c4e9;
    --tv-color-pane-background: rgb(251, 223, 244);
    --tv-color-pane-background-secondary: rgb(249, 185, 233);
    --tv-color-toolbar-button-background-hover: rgb(244, 143, 177);
    --tv-color-toolbar-button-background-secondary-hover: red;
    --tv-color-toolbar-button-background-expanded: rgb(244, 143, 177);
    --tv-color-toolbar-button-text: rgb(136, 24, 79);
    --tv-color-toolbar-button-text-hover: rgb(74, 20, 140);
    --tv-color-toolbar-button-text-active: red;
    --tv-color-toolbar-button-text-active-hover: red;
    --tv-color-item-active-text: rgb(6, 6, 255);
    --tv-color-toolbar-toggle-button-background-active: red;
    --tv-color-toolbar-toggle-button-background-active-hover: magenta;
}

.theme-dark:root {
    --tv-color-platform-background: #d1c4e9;
    --tv-color-pane-background: rgb(251, 223, 244);
    --tv-color-pane-background-secondary: rgb(249, 185, 233);
    --tv-color-toolbar-button-background-hover: rgb(244, 143, 177);
    --tv-color-toolbar-button-background-secondary-hover: red;
    --tv-color-toolbar-button-background-expanded: rgb(244, 143, 177);
    --tv-color-toolbar-button-text: rgb(136, 24, 79);
    --tv-color-toolbar-button-text-hover: rgb(74, 20, 140);
    --tv-color-toolbar-button-text-active: red;
    --tv-color-toolbar-button-text-active-hover: red;
    --tv-color-item-active-text: rgb(6, 255, 6);
    --tv-color-toolbar-toggle-button-background-active: red;
    --tv-color-toolbar-toggle-button-background-active-hover: magenta;
}
  • : root: not (.theme-dark) 选择器定义light主题的规则

  • .theme-dark: root 选择器定义dark主题的规则

可用变量:

  • --tv-color-platform-background - 设置所有元素的页面的主要颜色

  • --tv-color-pane-background - 工具栏背景色

  • --tv-color-pane-background-secondary - 工具栏的其他背景色(例如,右侧有打开的工具栏时)

  • --tv-color-toolbar-button-background-hover - 工具栏按钮的悬停效果颜色

  • --tv-color-toolbar-button-background-secondary-hover - 工具栏按钮的其他悬停颜色(例如,右侧有打开的工具栏时)

  • --tv-color-toolbar-button-background-expanded - 右侧工具栏上活动按钮的悬停效果颜色

  • --tv-color-toolbar-button-text - 工具栏按钮的文本和图标颜色

  • --tv-color-toolbar-button-text-hover - 将鼠标悬停在工具栏按钮上时,文本和图标的颜色

  • --tv-color-toolbar-button-text-active - 活动工具栏按钮的文本和图标颜色

  • --tv-color-toolbar-button-text-active-hover - 将鼠标悬停在它们上方时,工具栏按钮的文本和图标颜色

  • --tv-color-item-active-text - 切换工具栏按钮的文本颜色(例如,“磁铁模式”,“锁定所有图形”)

  • --tv-color-toolbar-toggle-button-background-active - 填充切换工具栏按钮的颜色(例如,“磁铁模式”,“锁定所有图形”)

  • --tv-color-toolbar-toggle-button-background-active-hover - 将切换工具栏按钮悬停在其上时填充颜色(例如,“磁铁模式”,“锁定所有图形”)

CSS files