alecthomas / alecthomas/chroma

With LineNumbersInTable enabled, highlighted line numbers have wrong height

未关闭
#722 4 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
5k
派生
522
平均合并
1 天 14 小时
30 天内合并 PR
11

描述

With `LineNumbersInTable` enabled, if the inherited CSS line height is greater than one, then the height of highlighted numbers is not equal to the height of the highlighted code.

![image](https://user-images.githubusercontent.com/335669/211472836-ecafff3c-8568-405c-8031-2e464b77f15f.png)

@willfaught suggested the following fix:

```css
.chroma .lntable .lnt,
.chroma .lntable .hl {
display: flex;
}
```

And while the body is open, perhaps we could make the second column take up the remaining width. You can see the difference above.

Using the [adjacent sibling combinator](https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator):

```css
.lntable .lntd + .lntd {
width: 100%;
}
```

With both of these changes:

![image](https://user-images.githubusercontent.com/335669/211476193-f15a0f28-5f06-4197-8f75-9992da2bd2b1.png)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。