Skip to content

Commit 6ce8742

Browse files
committed
🐛 fix: 有序列表编号问题 Thanks @yan-yunhua
1 parent 60d8c22 commit 6ce8742

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
167167
> [!warning]
168168
>
169-
> 默认风格某些情况下会出现[错位](https://github.com/caolib/typora-onelight-theme/issues/32)和[编号](https://github.com/caolib/typora-onelight-theme/issues/28)问题
169+
> 默认风格某些情况下会出现[错位](https://github.com/caolib/typora-onelight-theme/issues/32)
170170
171171
<div align="center">
172172
<table>

docs/README_en.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ Add `!important` if styles don't apply.
149149
#### 3.3.2 Lists
150150
151151
> [!warning]
152-
> Default style may cause [alignment](https://github.com/caolib/typora-onelight-theme/issues/32) or [numbering](https://github.com/caolib/typora-onelight-theme/issues/28) issues.
153-
152+
> Default style may cause [alignment](https://github.com/caolib/typora-onelight-theme/issues/32)
154153
<div align="center">
155154
<table>
156155
<tr>

onelight/style/list/list.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
position: absolute;
6666
}
6767

68-
#write .ol .li:first-child,
68+
/* #write .ol .li:first-child,
6969
#write ol li:first-child {
7070
counter-reset: li
71-
}
71+
} */
7272

7373
#write .ol .li:hover:before,
7474
#write .ul .li:hover:before,
@@ -86,17 +86,20 @@
8686
/* ---------------->> 有序列表前数字 <<---------------- */
8787
#write .ol>.li:before,
8888
#write ol>li:before {
89+
padding: 0 5px;
8990
border-radius: .825em;
9091
color: #fff;
91-
content: counter(li);
92+
content: counter(list-item);
9293
counter-increment: li;
9394
font-size: .65em;
9495
height: 1.65em;
9596
line-height: 1.7em;
9697
margin-left: -25px;
9798
margin-top: 10px;
9899
text-align: center;
99-
width: 1.65em;
100+
width: auto;
101+
min-width: 1.65em;
102+
white-space: nowrap;
100103
transition: transform 0.5s;
101104
}
102105

0 commit comments

Comments
 (0)