nimdoc: CSS: tighter on mobile; fix h1 print page break (#25607)

- Small optimizations for mobile, makes code render slightly tighter.
- `font-stretch: semi-condensed;` for pre works if the user's font
provides such a face, shouldn’t change the rendering with the default.
- Removes an excessive page break after the page header when printing.

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
This commit is contained in:
Zoom
2026-03-23 16:00:07 +04:00
committed by GitHub
parent 57e15cd9a4
commit 446d903fc1
2 changed files with 62 additions and 0 deletions

View File

@@ -259,6 +259,8 @@ body {
body {
font-size: 1em;
line-height: 1.35;
margin-left: 0.35em;
margin-right: 0.35em;
}
}
@@ -417,6 +419,10 @@ img {
h1.title {
page-break-before: avoid; }
.nine.columns h1:first-of-type {
page-break-before: avoid;
}
p, h2, h3 {
orphans: 3;
@@ -484,6 +490,22 @@ h5 {
h6 {
font-size: 1.1em; }
@media screen and (max-width: 860px) {
h1.title {
font-size: 2em;
}
h1 {
font-size: 1.5em;
margin-top: 1.5em;
margin-bottom: 0.75em;
}
h2 {
margin-top: 1.3em;
}
h3 {
margin-top: 1.2em;
}
}
ul, ol {
padding: 0;
@@ -667,6 +689,15 @@ pre {
border-radius: 6px;
}
@media screen and (max-width: 860px) {
pre {
font-stretch: semi-condensed;
letter-spacing: -0.25px;
line-height: 1.25;
padding: 0.33em;
}
}
.copyToClipBoardBtn {
visibility: hidden;
position: absolute;

View File

@@ -259,6 +259,8 @@ body {
body {
font-size: 1em;
line-height: 1.35;
margin-left: 0.35em;
margin-right: 0.35em;
}
}
@@ -417,6 +419,10 @@ img {
h1.title {
page-break-before: avoid; }
.nine.columns h1:first-of-type {
page-break-before: avoid;
}
p, h2, h3 {
orphans: 3;
@@ -484,6 +490,22 @@ h5 {
h6 {
font-size: 1.1em; }
@media screen and (max-width: 860px) {
h1.title {
font-size: 2em;
}
h1 {
font-size: 1.5em;
margin-top: 1.5em;
margin-bottom: 0.75em;
}
h2 {
margin-top: 1.3em;
}
h3 {
margin-top: 1.2em;
}
}
ul, ol {
padding: 0;
@@ -667,6 +689,15 @@ pre {
border-radius: 6px;
}
@media screen and (max-width: 860px) {
pre {
font-stretch: semi-condensed;
letter-spacing: -0.25px;
line-height: 1.25;
padding: 0.33em;
}
}
.copyToClipBoardBtn {
visibility: hidden;
position: absolute;