Skip to content

Commit 2df2dac

Browse files
-
1 parent ab0e508 commit 2df2dac

File tree

2 files changed

+78
-128
lines changed

2 files changed

+78
-128
lines changed

_layouts/post.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h2 class="title">{{ page.title }}</h2>
7070
</ul>
7171
</div><!-- End meta top -->
7272

73-
<div class="content post-content">
73+
<div class="content">
7474
{{ content }}
7575
</div><!-- End post content -->
7676

assets/css/markdown.css

Lines changed: 77 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
/* =========================================================
2-
Chirpy markdown-only extract
3-
source base: _site/assets/css/jekyll-theme-chirpy.css
4-
adapted only for scope + local variable fallback
5-
========================================================= */
1+
/* Chirpy markdown extract scoped to current post body */
62

73
.blog-details .content {
4+
--main-border-color: #f3f3f3;
85
--text-color: #34343c;
96
--text-muted-color: #757575;
107
--text-muted-highlight-color: inherit;
@@ -14,62 +11,27 @@
1411
--blockquote-text-color: #757575;
1512
--link-color: #0056b2;
1613
--link-underline-color: #dee2e6;
17-
--main-border-color: #f3f3f3;
1814
--tb-odd-bg: #fbfcfd;
1915
--tb-border-color: #eaeaea;
2016
--footnote-target-bg: lightcyan;
17+
--language-border-color: #ececec;
2118
--highlight-bg-color: #f6f8fa;
2219
--highlighter-rouge-color: #3f596f;
2320
--inline-code-bg: rgb(25 25 28 / 5%);
2421
--code-color: #3a3a3a;
22+
--filepath-text-color: #6c757d;
2523
--kbd-wrap-color: #bdbdbd;
2624
--kbd-text-color: var(--text-color);
2725
--kbd-bg-color: #fff;
26+
--code-header-text-color: #a3a3a3;
27+
--code-header-muted-color: #e5e5e5;
28+
--code-header-icon-color: #c9c8c8;
29+
2830
color: var(--text-color);
2931
word-wrap: break-word;
3032
overflow-wrap: break-word;
3133
}
3234

33-
/* headings */
34-
.blog-details .content h1,
35-
.blog-details .content h2,
36-
.blog-details .content h3,
37-
.blog-details .content h4,
38-
.blog-details .content h5 {
39-
color: var(--heading-color);
40-
font-weight: 400;
41-
font-family: Lato, "Microsoft Yahei", sans-serif;
42-
scroll-margin-top: 3.5rem;
43-
}
44-
45-
.blog-details .content h2 .anchor,
46-
.blog-details .content h3 .anchor,
47-
.blog-details .content h4 .anchor,
48-
.blog-details .content h5 .anchor {
49-
font-size: 80%;
50-
}
51-
52-
@media (hover: hover) {
53-
.blog-details .content h2 .anchor,
54-
.blog-details .content h3 .anchor,
55-
.blog-details .content h4 .anchor,
56-
.blog-details .content h5 .anchor {
57-
visibility: hidden;
58-
opacity: 0;
59-
transition: opacity 0.25s ease-in, visibility 0s ease-in 0.25s;
60-
}
61-
62-
.blog-details .content h2:hover .anchor,
63-
.blog-details .content h3:hover .anchor,
64-
.blog-details .content h4:hover .anchor,
65-
.blog-details .content h5:hover .anchor {
66-
visibility: visible;
67-
opacity: 1;
68-
transition: opacity 0.25s ease-in, visibility 0s ease-in 0s;
69-
}
70-
}
71-
72-
/* links */
7335
.blog-details .content a:not(.img-link) {
7436
color: var(--link-color);
7537
border-bottom: 1px solid var(--link-underline-color);
@@ -83,10 +45,13 @@
8345
}
8446

8547
.blog-details .content a.popup {
48+
-webkit-user-select: none;
8649
user-select: none;
8750
}
8851

89-
.blog-details .content a.popup + em {
52+
.blog-details .content a.popup + em,
53+
.blog-details .content .embed-video + em,
54+
.blog-details .content .embed-audio + em {
9055
display: block;
9156
text-align: center;
9257
font-style: normal;
@@ -95,45 +60,42 @@
9560
color: #6d6c6c;
9661
}
9762

98-
/* blockquote */
63+
.blog-details .content h1,
64+
.blog-details .content h2,
65+
.blog-details .content h3,
66+
.blog-details .content h4,
67+
.blog-details .content h5 {
68+
color: var(--heading-color);
69+
}
70+
9971
.blog-details .content blockquote {
100-
padding: 0.5rem 1rem;
10172
color: var(--blockquote-text-color);
10273
border-left: 5px solid var(--blockquote-border-color);
74+
padding: 0.5rem 1rem;
10375
}
10476

10577
.blog-details .content blockquote > p {
10678
margin: 0;
10779
}
10880

109-
/* inline code */
110-
.blog-details .content code.highlighter-rouge {
111-
padding: 0.1em 0.3em;
112-
border-radius: 0.25rem;
113-
color: var(--highlighter-rouge-color);
114-
background-color: var(--inline-code-bg);
115-
font-size: 0.95em;
116-
}
117-
118-
.blog-details .content code.filepath {
119-
background-color: inherit;
120-
padding: 0;
121-
border: none;
122-
border-radius: 0;
123-
}
124-
125-
.blog-details .content code {
126-
color: var(--code-color);
81+
.blog-details .content sup:target,
82+
.blog-details .content .footnotes > ol > li:target {
83+
background-color: var(--footnote-target-bg);
84+
width: fit-content;
85+
transition: background-color 1.75s ease-in-out;
12786
}
12887

129-
/* code block */
13088
.blog-details .content .highlight,
13189
.blog-details .content figure.highlight,
13290
.blog-details .content div[class^="language-"] {
13391
background-color: var(--highlight-bg-color);
13492
border-radius: 10px;
13593
}
13694

95+
.blog-details .content div[class^="language-"] {
96+
box-shadow: var(--language-border-color) 0 0 0 1px;
97+
}
98+
13799
.blog-details .content div.highlighter-rouge {
138100
position: relative;
139101
margin-bottom: 1rem;
@@ -157,21 +119,62 @@
157119
tab-size: 2;
158120
}
159121

160-
/* rouge line number support */
161122
.blog-details .content td.rouge-code {
162123
padding-left: 1rem;
163124
padding-right: 1.5rem;
164125
}
165126

166-
/* table - actual chirpy uses .table-wrapper > table
167-
fallback added for plain markdown tables in current site */
127+
.blog-details .content code.highlighter-rouge {
128+
font-size: 0.85rem;
129+
padding: 3px 5px;
130+
overflow-wrap: break-word;
131+
border-radius: 6px;
132+
background-color: var(--inline-code-bg);
133+
color: var(--highlighter-rouge-color);
134+
}
135+
136+
.blog-details .content code.filepath {
137+
background-color: inherit;
138+
color: var(--filepath-text-color);
139+
font-weight: 600;
140+
padding: 0;
141+
}
142+
143+
.blog-details .content a > code.highlighter-rouge {
144+
padding-bottom: 0;
145+
color: inherit;
146+
}
147+
148+
.blog-details .content a:hover > code.highlighter-rouge {
149+
border-bottom: none;
150+
}
151+
152+
.blog-details .content blockquote code {
153+
color: inherit;
154+
}
155+
156+
.blog-details .content code {
157+
color: var(--code-color);
158+
}
159+
160+
.blog-details .content td.rouge-code a {
161+
color: inherit !important;
162+
border-bottom: none !important;
163+
pointer-events: none;
164+
}
165+
166+
.blog-details .content .table-wrapper {
167+
overflow-x: auto;
168+
margin-bottom: 1rem;
169+
}
170+
168171
.blog-details .content .table-wrapper > table,
169172
.blog-details .content table {
170-
vertical-align: middle;
171173
min-width: 100%;
172174
max-width: 100%;
173175
margin-bottom: 1rem;
174176
border-collapse: collapse;
177+
vertical-align: middle;
175178
}
176179

177180
.blog-details .content .table-wrapper > table thead th,
@@ -195,12 +198,6 @@
195198
background-color: var(--tb-odd-bg);
196199
}
197200

198-
.blog-details .content .table-wrapper {
199-
overflow-x: auto;
200-
margin-bottom: 1rem;
201-
}
202-
203-
/* images and captions */
204201
.blog-details .content img {
205202
max-width: 100%;
206203
height: auto;
@@ -210,25 +207,6 @@
210207
border-radius: 10px;
211208
}
212209

213-
.blog-details .content img + em,
214-
.blog-details .content .embed-video + em,
215-
.blog-details .content .embed-audio + em {
216-
display: block;
217-
text-align: center;
218-
font-style: normal;
219-
font-size: 80%;
220-
padding: 0;
221-
color: #6d6c6c;
222-
}
223-
224-
/* footnotes */
225-
.blog-details .content sup:target,
226-
.blog-details .content .footnotes > ol > li:target {
227-
background-color: var(--footnote-target-bg);
228-
width: fit-content;
229-
transition: background-color 1.75s ease-in-out;
230-
}
231-
232210
.blog-details .content .footnotes {
233211
margin-top: 2rem;
234212
}
@@ -241,15 +219,14 @@
241219
margin-bottom: 0.5rem;
242220
}
243221

244-
/* kbd */
245222
.blog-details .content kbd {
246223
display: inline-block;
247-
vertical-align: middle;
248-
line-height: 1.3rem;
249224
min-width: 1.75rem;
250225
text-align: center;
251226
margin: 0 0.3rem;
252227
padding: 0.1rem 0.4rem;
228+
line-height: 1.3rem;
229+
vertical-align: middle;
253230
color: var(--kbd-text-color);
254231
background-color: var(--kbd-bg-color);
255232
border: 1px solid var(--kbd-wrap-color);
@@ -258,40 +235,13 @@
258235
box-shadow: inset 0 -1px 0 var(--kbd-wrap-color);
259236
}
260237

261-
/* hr */
262238
.blog-details .content hr {
263239
border-color: var(--main-border-color);
264240
opacity: 1;
265241
}
266242

267-
/* list spacing */
268-
.blog-details .content ul,
269-
.blog-details .content ol {
270-
padding-left: 1.5rem;
271-
}
272-
273-
.blog-details .content li + li {
274-
margin-top: 0.25rem;
275-
}
276-
277-
/* small muted text blocks used around markdown */
278-
.blog-details .content em,
279-
.blog-details .content small {
280-
color: var(--text-muted-color);
281-
}
282-
283-
/* mobile tweak from chirpy */
284243
@media all and (max-width: 768px) {
285244
.blog-details .content > p > img {
286245
max-width: calc(100% + 1rem);
287246
}
288-
}
289-
290-
/* heading offset from chirpy */
291-
@media all and (min-width: 1200px) {
292-
.blog-details .content h2,
293-
.blog-details .content h3,
294-
.blog-details .content h4 {
295-
scroll-margin-top: 2rem;
296-
}
297247
}

0 commit comments

Comments
 (0)