Skip to content

feat: mobile reading #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions Manual/Meta/Marginalia.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,41 @@ def Marginalia.css := r#"
padding: 0.5rem;
}
/* Wide viewport */
@media (min-width: 1400px) {
.marginalia .note {
float: right;
clear: right;
margin-right: -19vw;
width: 15vw;
margin-top: 1rem;
}
@media screen and (min-width: 1400px) {
.marginalia .note {
float: right;
clear: right;
margin-right: -19vw;
width: 15vw;
margin-top: 1rem;
}
}

.marginalia:hover, .marginalia:hover .note, .marginalia:has(.note:hover) {
background-color: var(--lean-accent-light-blue);
}

/* Narrow viewport */
@media (max-width: 1400px) {
.marginalia .note {
float: right;
clear: right;
width: 40%;
margin: 1rem 0;
margin-left: 5%;
/* Medium viewport */
@media screen and (700px < width <= 1400px) {
.marginalia .note {
float: right;
clear: right;
width: 40%;
margin: 1rem 0;
margin-left: 5%;
}
}

/* Narrow viewport (e.g. phone) */
@media screen and (width <= 700px) {
.marginalia .note {
float: left;
clear: left;
width: 90%;
margin: 1rem 5%;
}
}

body {
counter-reset: margin-note-counter;
}
Expand Down
2 changes: 1 addition & 1 deletion lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b1d1865f979882dbc52c386877bc6708d9b56aec",
"rev": "314e77088df5c4fa8e072d88e66af3599aca8350",
"name": "verso",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand Down
11 changes: 2 additions & 9 deletions static/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,11 @@ figcaption {
position: fixed;
top: 0;
right: 0;
transform:
/* first undo the effect of the rotation, pushing it to the right*/
translateX(25%)
/* then shove it against the side, sticking the box out of the viewport */
translateX(5em) translateY(-5em)
/* and rotate! */
rotate(45deg);
transform-origin: top left;
padding: 1em 8em;
padding: 0.5rem 1rem;
background-color: var(--lean-compl-yellow);
font-family: var(--verso-structure-font-family);
font-size: large;
z-index: 9; /* Just below the ToC */
}
}

Expand Down
Loading