From 10708efbf8a2bc39424eda8c8d77e9371c3fceeb Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 24 Jan 2020 14:05:54 -0300 Subject: CSS: Add line numbers to
 blocks

Taken from:
https://gist.github.com/potch/1243028

Reference:
https://github.com/jaspervdj/hakyll/issues/148
---
 site/css/styles.css | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/site/css/styles.css b/site/css/styles.css
index 240c61b..6bafcbc 100644
--- a/site/css/styles.css
+++ b/site/css/styles.css
@@ -134,6 +134,19 @@ h2 {
 pre {
   font-family: "Inconsolata",monospace;
   white-space: pre-wrap;
+  border-left: 3ex solid #eee;
+  position: relative;
+  counter-reset: linenumbers;
+}
+
+pre a:before {
+  color: #aaa;
+  content: counter(linenumbers);
+  counter-increment: linenumbers;
+  left: -3ex;
+  position: absolute;
+  text-align: right;
+  width: 2.5ex;
 }
 
 code {
-- 
cgit v1.2.3