Revert "Fix margin collapse issue" and adjust whitespace to compensate

This reverts commit a806fc41a8.
This commit is contained in:
Brandon 2022-11-13 23:18:41 -08:00 committed by Alex Cabal
parent 13f15e34a1
commit 88e7f63486
2 changed files with 11 additions and 12 deletions

View file

@ -310,8 +310,8 @@ do
# We do this first because the tweaks below shouldn't apply to the single-page file
se recompose-epub --xhtml --output "${workDir}"/single-page.xhtml --extra-css-file="${webRoot}/css/web.css" "${workDir}"
# Wrap book contents in a <main> tag (and extra <div> for styling reasons)
sed --in-place --regexp-extended "s|<body([^>]*)>|<body><main\1><div>|; s|</body>|</div></main></body>|" "${workDir}"/single-page.xhtml
# Wrap book contents in a <main> tag
sed --in-place --regexp-extended "s|<body([^>]*)>|<body><main\1>|; s|</body>|</main></body>|" "${workDir}"/single-page.xhtml
# Add a navbar with a link back to the homepage
sed --in-place --regexp-extended "s|<body([^>]*)>|<body\1><header><nav><ul><li><a href=\"/\">Standard Ebooks</a></li><li><a href=\"${bookUrl}\">Back to ebook</a></li></ul></nav></header>|" "${workDir}"/single-page.xhtml
@ -342,8 +342,8 @@ do
workTitle=$(grep --only-matching --extended-regexp "<dc:title id=\"title\">(.+?)</dc:title>" "${workDir}"/src/epub/content.opf | sed --regexp-extended "s/<[^>]+?>//g")
find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s|<title>|<title>${workTitle} - |g"
# Wrap book contents in a <main> tag (and extra <div> for styling reasons)
find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s%<body([^>]*)>%<body><main\1><div>%; s%</body>%</div></main></body>%"
# Wrap book contents in a <main> tag
find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s%<body([^>]*)>%<body><main\1>%; s%</body>%</main></body>%"
# Add the header nav to each page
find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s%<body([^>]*)>%<body\1><header><nav><ul><li><a href=\"/\">Standard Ebooks</a></li><li><a href=\"${bookUrl}\">Back to ebook</a></li><li><a href=\"${bookUrl}/text\">Table of contents</a></li></ul></nav></header>%"

View file

@ -10,13 +10,11 @@ body{
}
main{
flex-grow: 1;
}
main > div{
margin: 8rem auto 3rem;
margin: 5rem auto 3rem;
max-width: 55ch;
padding: 0 3rem;
width: calc(100% - 2 * 3rem); /* calc instead of box-sizing: border-box which would make max-width count padding */
flex-grow: 1;
}
body > header{
@ -73,8 +71,8 @@ body > footer li{
max-width: 40%;
}
body > main > div > section[epub|type~="titlepage"],
body > main > div > section[epub|type~="halftitlepage"]{
body > main > section[epub|type~="titlepage"],
body > main > section[epub|type~="halftitlepage"]{
min-height: auto;
}
@ -94,8 +92,9 @@ nav[epub|type~="toc"] ol{
}
@media(max-width: 65ch){
main > div{
main{
padding: 0 2rem;
width: calc(100% - 2 * 2rem);
}
section[epub|type~="imprint"] p{