Skip to content

Commit 3d146a9

Browse files
committed
Tweak dark theme diff highlight
The line background extension doesn't cover wrapped lines, but I don't see an easy solution so it's fine.
1 parent bdad783 commit 3d146a9

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

static/custom.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,9 @@ pre.lang:after {
153153
z-index: 5;
154154
scroll-margin-top: 200px;
155155
}
156+
157+
@media (min-width: 768px) {
158+
.input-group {
159+
max-width: 250px;
160+
}
161+
}

static/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
<div class="ml-auto d-flex mt-1 mt-md-0 mb-1 mb-md-0">
8383
{{#if (or is_editable is_created)}}
8484
<div class="input-group mr-2">
85-
<div class="input-group-prepend">
86-
<button class="btn btn-outline-secondary" id="diff-button" type="button" aria-pressed="false">Diff</button>
85+
<div class="input-group-prepend" title="Diff">
86+
<button class="btn btn-outline-secondary" id="diff-button" type="button" aria-pressed="false">±</button>
8787
</div>
8888
<select class="form-control" id="language-selector">
8989
<option value="log">Log file</option>

static/prism-coldark-pb.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,15 @@ pre[class*="language-"] {
208208

209209
/* Diff Highlight plugin overrides */
210210
.token.deleted {
211-
color: #9c3b22;
211+
color: #f4886d;
212212
}
213213
.token.inserted {
214-
color: #507f3c;
214+
color: #89bd73;
215215
}
216216

217217
pre.diff-highlight > code .token.deleted:not(.prefix),
218-
pre > code.diff-highlight .token.deleted:not(.prefix) {
218+
pre > code.diff-highlight .token.deleted:not(.prefix),
219+
.token.prefix.deleted::before {
219220
background-color: lch(14 14 23);
220221
}
221222

@@ -227,7 +228,8 @@ pre > code.diff-highlight .token.deleted:not(.prefix) *::selection {
227228
}
228229

229230
pre.diff-highlight > code .token.inserted:not(.prefix),
230-
pre > code.diff-highlight .token.inserted:not(.prefix) {
231+
pre > code.diff-highlight .token.inserted:not(.prefix),
232+
.token.prefix.inserted::before {
231233
background-color: lch(17 18 137);
232234
}
233235

@@ -237,3 +239,11 @@ pre > code.diff-highlight .token.inserted:not(.prefix)::selection,
237239
pre > code.diff-highlight .token.inserted:not(.prefix) *::selection {
238240
background-color: lch(23 18 137);
239241
}
242+
243+
.token.prefix.inserted::before,
244+
.token.prefix.deleted::before {
245+
content: " ";
246+
display: inline-block;
247+
width: 5px;
248+
margin-left: -5px;
249+
}

0 commit comments

Comments
 (0)