aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/shiki.css
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-20 21:57:25 +0900
committernsfisis <nsfisis@gmail.com>2025-03-20 21:57:58 +0900
commit1204620ab9852b5acf02d922e1679f28e58cc35d (patch)
tree532ed9b7348f381ef6599faa69bdcbcac6417dd1 /frontend/app/shiki.css
parent0bc943a36c9992d1098d92812b19b70d371e6a0d (diff)
downloadphperkaigi-2025-albatross-1204620ab9852b5acf02d922e1679f28e58cc35d.tar.gz
phperkaigi-2025-albatross-1204620ab9852b5acf02d922e1679f28e58cc35d.tar.zst
phperkaigi-2025-albatross-1204620ab9852b5acf02d922e1679f28e58cc35d.zip
feat(frontend): show line number
Diffstat (limited to 'frontend/app/shiki.css')
-rw-r--r--frontend/app/shiki.css18
1 files changed, 17 insertions, 1 deletions
diff --git a/frontend/app/shiki.css b/frontend/app/shiki.css
index 91b6e18..9e456fe 100644
--- a/frontend/app/shiki.css
+++ b/frontend/app/shiki.css
@@ -1,3 +1,19 @@
-pre.shiki {
+.shiki {
white-space: pre-wrap;
}
+
+/* https://github.com/shikijs/shiki/issues/3 */
+.shiki code {
+ counter-reset: line-number;
+ counter-increment: line-number 0;
+}
+
+.shiki code .line::before {
+ content: counter(line-number);
+ counter-increment: line-number;
+ width: 2rem;
+ margin-right: 1.5rem;
+ display: inline-block;
+ text-align: right;
+ color: #aaa;
+}