【问题标题】:How to change font color of button icons for trix text editor toolbar如何更改 trix 文本编辑器工具栏按钮图标的字体颜色
【发布时间】:2021-11-23 10:11:33
【问题描述】:

我想更改按钮图标的字体颜色。

我用 sass 尝试了以下操作:

trix-toolbar
  .trix-button
    background-color: $purple-dark-2
    color: $white

它只改变背景颜色,如下所示:

我只发现了关于如何在工具栏中添加新按钮的不同方法。 这两个在我看来是最有前途的:

https://codepen.io/souporserious/pen/dYZVYo?editors=100

https://jsfiddle.net/34sd91hv/

【问题讨论】:

    标签: javascript css trix


    【解决方案1】:

    我发现他们使用材料图标并且可以替换它们: https://github.com/basecamp/trix/issues/464

    类似这样的关于你的路径的东西也会起作用:

    trix-toolbar
      .trix-button--icon-bold::before
        background-image: url('../images/icon/baseline_format_bold_white_24dp.png')
    

    sn-p 在 sass 中,您可以转换为 css 或 scss,甚至可以使用 .svg 文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-19
      • 1970-01-01
      • 1970-01-01
      • 2016-11-07
      • 1970-01-01
      • 2017-11-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多