-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
themeRelated to the themeRelated to the theme
Description
Is your feature request related to a problem? Please describe.
default font is non-monospace font

Describe the solution you'd like
support monospace font when using ol, like doubao豆包 AI fixed:
.vp-doc ol {
list-style: none;
counter-reset: order-num;
padding-left: 0;
margin: 0;
}
.vp-doc ol li {
counter-increment: order-num;
padding-left: 1.75em; /* 给序号预留空间 */
/* 这里不设置font-family,让内容继承页面原始字体 */
}
/* 仅序号伪元素使用等宽字体 */
.vp-doc ol li::before {
content: counter(order-num) ".";
width: 1.25em;
text-align: right;
position: absolute;
left: 0;
/* 只在序号这里用等宽字体 */
font-family: "Consolas", "Monaco", "Courier New", monospace;
font-size: inherit; /* 继承列表项字号,保持视觉统一 */
}
但是用伪元素这种解决方案也是有问题,比如:
1) 测试机配置
|配置参数|值|
|---|---|
|Vender ID|Genuine Intel|
|CPU Family|6|
|Model|45|
|Model Name|Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz|
|核心数|12|
|内存大小|132137288KB(约126GB)|
2) 测试场景:xxxxx
这种情况,2就会被渲染为1,因为间隔了一个表格,会重新计数。
期待前端大佬有好的解决方法。
Describe alternatives you've considered
No response
Additional context
Validations
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
themeRelated to the themeRelated to the theme