Skip to content

Commit 4d1ab4b

Browse files
committed
Refactor code.css (used in EPUB)
1 parent a354769 commit 4d1ab4b

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

assets/css/content/code.css

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1+
/* Additionally used in EPUB styles.
2+
* Use basic selectors for rules that should apply in ebook readers */
3+
14
/* The Consolas font on Windows is too small compared to other ones */
25
@font-face {
36
font-family: "Consolas";
47
src: local("Consolas");
58
size-adjust: 110%;
69
}
710

8-
.content-inner.content-inner :is(a:has(code, img), pre a) {
9-
color: var(--link-color);
10-
text-shadow: none;
11-
text-decoration: none;
12-
background-image: none;
13-
}
11+
.content-inner.content-inner {
12+
& :is(a:has(code, img), pre a) {
13+
color: var(--link-color);
14+
text-shadow: none;
15+
text-decoration: none;
16+
background-image: none;
1417

15-
.content-inner.content-inner :is(a:has(code, img), pre a):is(:visited, :active, :focus, :hover) {
16-
color: var(--link-visited-color);
18+
:is(:visited, :active, :focus, :hover) {
19+
color: var(--link-visited-color);
20+
}
21+
}
1722
}
1823

1924
.content-inner strong > code {
@@ -39,7 +44,12 @@
3944
word-wrap: break-word;
4045
}
4146

42-
.content-inner :is(h1, h2, h3, h4, h5, h6) code {
47+
.content-inner h1 code,
48+
.content-inner h2 code,
49+
.content-inner h3 code,
50+
.content-inner h4 code,
51+
.content-inner h5 code,
52+
.content-inner h6 code {
4353
font-size: 0.875em;
4454
}
4555

@@ -83,8 +93,8 @@
8393
}
8494

8595
@media screen and (max-width: 768px) {
86-
.content-inner > pre:has(code),
87-
.content-inner section > pre:has(code) {
96+
.content-inner > pre,
97+
.content-inner section > pre {
8898
margin-left: calc(-1 * var(--content-gutter));
8999
margin-right: calc(-1 * var(--content-gutter));
90100
}

0 commit comments

Comments
 (0)