Fix line numbers display and alignment
ci/woodpecker/push/woodpecker Pipeline failed Details

- Set consistent line-height (18.2px) across linenos, code box, and hljs
- Fix linenos z-index to ensure visibility
- Remove padding from hljs to align with line numbers
- Add user-select: none to prevent selecting line numbers
This commit is contained in:
Colin 2026-01-23 09:38:06 -05:00
parent ebcb90ca18
commit 81dea94128
Signed by: colin
SSH Key Fingerprint: SHA256:nRPCQTeMFLdGytxRQmPVK9VXY3/ePKQ5lGRyJhT5DY8
2 changed files with 13 additions and 5 deletions

View File

@ -34,15 +34,19 @@ textarea {
/* the line numbers */ /* the line numbers */
#linenos { #linenos {
color: #7d7d7d; color: #7d7d7d;
z-index: -1000; z-index: 1;
position: absolute; position: absolute;
top: 20px; top: 20px;
left: 0px; left: 0px;
width: 30px; /* 30 to get 20 away from box */ width: 40px;
font-size: 13px; font-size: 13px;
font-family: monospace; font-family: monospace;
text-align: right; text-align: right;
line-height: 18.2px;
padding-right: 10px;
box-sizing: border-box;
user-select: none;
} }
/* code box when locked */ /* code box when locked */
@ -55,12 +59,14 @@ textarea {
outline: none; outline: none;
font-size: 13px; font-size: 13px;
padding-right: 360px; padding-right: 360px;
overflow: inherit; overflow: inherit;
line-height: 18.2px;
} }
#box code { #box code {
padding: 0px; padding: 0px;
background: transparent !important; /* don't hide hastebox */ background: transparent !important; /* don't hide hastebox */
line-height: 18.2px;
} }
/* key */ /* key */

View File

@ -7,9 +7,11 @@ Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmai
.hljs { .hljs {
display: block; display: block;
overflow-x: auto; overflow-x: auto;
padding: 0.5em; padding: 0;
background: #002b36; background: #002b36;
color: #839496; color: #839496;
line-height: 18.2px;
font-size: 13px;
} }
.hljs-comment, .hljs-comment,