議論 » Greasy Fork への意見

Line numbers above 9999 don't fit.

§
投稿日: 2023/11/26
編集日: 2023/11/26

There is seems to be a browser limitation for <ol> lists, where only last 4 digits are fit in the available width. So, if script has more than 9999 lines, it starts showing incorrect line numbers.

A quick CSS-only solution for modern browsers:

ol
{
  --offset: 3.5ch;
  padding-inline-start:var(--offset);
}
ol:has(li:nth-child(10)){--offset:4.5ch}
ol:has(li:nth-child(100)){--offset:5.5ch}
ol:has(li:nth-child(1000)){--offset:6.5ch}
ol:has(li:nth-child(10000)){--offset:7.5ch}
ol:has(li:nth-child(100000)){--offset:8.5ch}
ol:has(li:nth-child(1000000)){--offset:9.5ch}
ol:has(li:nth-child(10000000)){--offset:10.5ch}
ol:has(li:nth-child(100000000)){--offset:11.5ch}
ol:has(li:nth-child(1000000000)){--offset:12.5ch}
ol:has(li:nth-child(10000000000)){--offset:13.5ch}
ol:has(li:nth-child(100000000000)){--offset:14.5ch}
ol:has(li:nth-child(1000000000000)){--offset:15.5ch}

§
投稿日: 2023/11/28
編集日: 2023/11/28

Yes. The code viewer in GreasyFork is quite simple and basic.

You might consider using this to view code in GreasyFork. (just viewing, not editing)

https://greasyfork.org/en/scripts/472051

§
投稿日: 2024/08/10

You might consider using this to view code in GreasyFork. (just viewing, not editing)

It actually works about 5 times faster for larger scripts (10k+ lines) Thanks!

返信を投稿

返信を投稿するにはログインしてください。