Skip to content

Commit 0f28ee2

Browse files
authored
Add styles to be in sync with Jekyll's mark_lines feature (#892)
Merge pull request 892
1 parent 79af56a commit 0f28ee2

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

_posts/2016-05-19-codeblocks-ahoy.md

+36
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@ author:
8686
id: 75636474
8787
```
8888
89+
{% highlight html %}
90+
<html>
91+
<head>
92+
<meta charset="utf-8" />
93+
<title>Hello World</title>
94+
</head>
95+
<body>
96+
<p>Hello, World!</p>
97+
</body>
98+
</html>
99+
{% endhighlight %}
100+
101+
{% highlight html mark_lines="1 4 7" %}
102+
<html>
103+
<head>
104+
<meta charset="utf-8" />
105+
<title>Hello World</title>
106+
</head>
107+
<body>
108+
<p>Hello, World!</p>
109+
</body>
110+
</html>
111+
{% endhighlight %}
112+
89113
{% highlight html linenos %}
90114
<html>
91115
<head>
@@ -97,3 +121,15 @@ author:
97121
</body>
98122
</html>
99123
{% endhighlight %}
124+
125+
{% highlight html linenos mark_lines="1 4 7" %}
126+
<html>
127+
<head>
128+
<meta charset="utf-8" />
129+
<title>Hello World</title>
130+
</head>
131+
<body>
132+
<p>Hello, World!</p>
133+
</body>
134+
</html>
135+
{% endhighlight %}

_sass/minima/_base.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ div.highlight, figure.highlight {
193193
padding: 0;
194194
border: 0
195195
}
196+
.lineno, .gl { text-align: right }
196197
}
197198

198199
figure.highlight {
199-
& > pre { padding: 5px 0 0 }
200+
table { margin: -8px -12px -14px }
200201
td.gutter { border-right: 1px solid $border-color-01 }
201202
td.code { width: 100% }
202203
}

_sass/minima/skins/auto.scss

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ $lm-table-border-color: $lm-border-color-01 !default;
112112
.w { color: #bbbbbb } // Text.Whitespace
113113

114114
.lineno, .gl { color: #9c9996 } // Line Number
115+
.hll { background-color: #ffffcc } // Marked-lines
115116
}
116117
}
117118

@@ -225,6 +226,7 @@ $dm-table-border-color: $dm-border-color-01 !default;
225226
.w { color: #eeffff } // Text.Whitespace
226227

227228
.lineno, .gl { color: #8a8a8a } // Line Number
229+
.hll { background-color: #373730 } // Marked-lines
228230
}
229231
}
230232

_sass/minima/skins/solarized.scss

+11
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ $sol-mono1-dimmed: darken($sol-base1, 20%);
7474
$sol-link-color: $sol-dark-blue;
7575
$sol-link-visited: $sol-dark-blue2;
7676

77+
$sol-mark-line-bgcolor: #ffffcc;
78+
7779
@if $sol-is-dark {
7880
$sol-mono3: $sol-base03;
7981
$sol-mono2: $sol-base02;
@@ -88,6 +90,8 @@ $sol-link-visited: $sol-dark-blue2;
8890
$sol-mono1-dimmed: lighten($sol-base01, 16%);
8991
$sol-link-color: $sol-light-blue;
9092
$sol-link-visited: $sol-light-blue2;
93+
94+
$sol-mark-line-bgcolor: #164145;
9195
}
9296

9397
@if $sol-is-auto {
@@ -105,6 +109,8 @@ $sol-link-visited: $sol-dark-blue2;
105109
--solarized-mono1-dimmed: #{darken($sol-base1, 20%)};
106110
--solarized-link-color: #{$sol-dark-blue};
107111
--solarized-link-visited: #{$sol-dark-blue2};
112+
113+
--solarized-mark-line-bg-color: #ffffcc;
108114
}
109115

110116
@media (prefers-color-scheme: dark) {
@@ -122,6 +128,8 @@ $sol-link-visited: $sol-dark-blue2;
122128
--solarized-mono1-dimmed: #{lighten($sol-base01, 16%)};
123129
--solarized-link-color: #{$sol-light-blue};
124130
--solarized-link-visited: #{$sol-light-blue2};
131+
132+
--solarized-mark-line-bg-color: #164145;
125133
}
126134
}
127135

@@ -138,6 +146,8 @@ $sol-link-visited: $sol-dark-blue2;
138146
$sol-mono1-dimmed: var(--solarized-mono1-dimmed);
139147
$sol-link-color: var(--solarized-link-color);
140148
$sol-link-visited: var(--solarized-link-visited);
149+
150+
$sol-mark-line-bgcolor: var(--solarized-mark-line-bg-color);
141151
}
142152

143153

@@ -244,4 +254,5 @@ $table-border-color: $sol-mix1 !default;
244254
.w { color: $sol-mono1 } // Text.Whitespace
245255

246256
.lineno, .gl { color: $sol-mono1 } // Line Number
257+
.hll { background-color: $sol-mark-line-bgcolor } // Marked-lines
247258
}

0 commit comments

Comments
 (0)