Skip to content

Commit a725f98

Browse files
feat: mobile reading (#148)
Update Verso to get CSS fixes for mobile browsers, and make the preview banner less ostentatious.
1 parent 6d7aca6 commit a725f98

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

Manual/Meta/Marginalia.lean

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,41 @@ def Marginalia.css := r#"
2222
padding: 0.5rem;
2323
}
2424
/* Wide viewport */
25-
@media (min-width: 1400px) {
26-
.marginalia .note {
27-
float: right;
28-
clear: right;
29-
margin-right: -19vw;
30-
width: 15vw;
31-
margin-top: 1rem;
32-
}
25+
@media screen and (min-width: 1400px) {
26+
.marginalia .note {
27+
float: right;
28+
clear: right;
29+
margin-right: -19vw;
30+
width: 15vw;
31+
margin-top: 1rem;
32+
}
3333
}
3434
3535
.marginalia:hover, .marginalia:hover .note, .marginalia:has(.note:hover) {
3636
background-color: var(--lean-accent-light-blue);
3737
}
3838
39-
/* Narrow viewport */
40-
@media (max-width: 1400px) {
41-
.marginalia .note {
42-
float: right;
43-
clear: right;
44-
width: 40%;
45-
margin: 1rem 0;
46-
margin-left: 5%;
39+
/* Medium viewport */
40+
@media screen and (700px < width <= 1400px) {
41+
.marginalia .note {
42+
float: right;
43+
clear: right;
44+
width: 40%;
45+
margin: 1rem 0;
46+
margin-left: 5%;
47+
}
4748
}
49+
50+
/* Narrow viewport (e.g. phone) */
51+
@media screen and (width <= 700px) {
52+
.marginalia .note {
53+
float: left;
54+
clear: left;
55+
width: 90%;
56+
margin: 1rem 5%;
57+
}
4858
}
59+
4960
body {
5061
counter-reset: margin-note-counter;
5162
}

lake-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "",
28-
"rev": "b1d1865f979882dbc52c386877bc6708d9b56aec",
28+
"rev": "314e77088df5c4fa8e072d88e66af3599aca8350",
2929
"name": "verso",
3030
"manifestFile": "lake-manifest.json",
3131
"inputRev": "main",

static/theme.css

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,11 @@ figcaption {
115115
position: fixed;
116116
top: 0;
117117
right: 0;
118-
transform:
119-
/* first undo the effect of the rotation, pushing it to the right*/
120-
translateX(25%)
121-
/* then shove it against the side, sticking the box out of the viewport */
122-
translateX(5em) translateY(-5em)
123-
/* and rotate! */
124-
rotate(45deg);
125-
transform-origin: top left;
126-
padding: 1em 8em;
118+
padding: 0.5rem 1rem;
127119
background-color: var(--lean-compl-yellow);
128120
font-family: var(--verso-structure-font-family);
129121
font-size: large;
122+
z-index: 9; /* Just below the ToC */
130123
}
131124
}
132125

0 commit comments

Comments
 (0)