【问题标题】:Is there a way to change the color of the left pane that has the line numbers of Ace-Editor in React?有没有办法在 React 中更改具有 Ace-Editor 行号的左窗格的颜色?
【发布时间】:2022-12-03 02:50:46
【问题描述】:

我已经尝试使用 AceEditor 提供的样式道具设置背景颜色,但这只适用于正文。如何将具有行号的左窗格的背景颜色也更改为透明?

      <AceEditor
        mode="javascript"
        theme="dreamweaver"
        // onChange={onChange}
        style={{
          backgroundColor: "transparent",
          fontSize: "1.2rem",
          color: "white",
        }}
        name="UNIQUE_ID_OF_DIV"
        editorProps={{ $blockScrolling: true }}
        value={`function onLoad(editor) {
                  console.log("i've loaded");
              }
             `}
      />

【问题讨论】:

    标签: reactjs ace-editor


    【解决方案1】:

    以非 React 特定的方式,您可以像这样使用 CSS 更改行号面板(“装订线”)背景

    .ace-tm .ace_gutter {
        background: #F8F8F8;
    }
    

    【讨论】:

      猜你喜欢
      • 2015-04-01
      • 1970-01-01
      • 2013-02-01
      • 2023-03-05
      • 1970-01-01
      • 2018-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多