diff --git a/assets/css/content/general.css b/assets/css/content/general.css index 407c2de41..c269e8fe4 100644 --- a/assets/css/content/general.css +++ b/assets/css/content/general.css @@ -74,16 +74,21 @@ /* Headings Summary, Callbacks and Functions sections output h1 and h2, which we style as h2 and h3. */ - .content-inner { + --h1-size: 1.5rem; + --h2-size: 1.35rem; + --h3-size: 1.25rem; + --h4-h5-size: 1.15rem; + --h6-size: 1rem; + & h1 { - font-size: 2rem; + font-size: var(--h1-size); margin-top: 1.75em; } & h2, & :is(#summary, #callbacks, #functions) > h1.section-heading { - font-size: 1.75rem; + font-size: var(--h2-size); margin-top: 1.5em; margin-bottom: 0.5em; } @@ -91,13 +96,13 @@ which we style as h2 and h3. */ & h3, & :is(#summary, #callbacks, #functions) > h2.section-heading, & #summary :is(.summary-callbacks, .summary-functions) h2 { - font-size: 1.45rem; + font-size: var(--h3-size); margin-top: 1.5em; margin-bottom: 0.5em; } & :is(h4, h5, h6) { - font-size: 1.15rem; + font-size: var(--h4-h5-size); margin-top: 1.25em; margin-bottom: 0.5em; } @@ -107,7 +112,14 @@ which we style as h2 and h3. */ } & h6 { - font-size: 1rem; + font-size: var(--h6-size); + } +} +@container content (width > 600px) { + .content-inner { + --h1-size: 2rem; + --h2-size: 1.75rem; + --h3-size: 1.45rem; } } diff --git a/assets/css/layout.css b/assets/css/layout.css index de51b1ced..27c52e997 100644 --- a/assets/css/layout.css +++ b/assets/css/layout.css @@ -1,3 +1,11 @@ +/* Layout container contexts */ + +#main { + container: content / inline-size; +} + +/* Layout styles */ + html, body { box-sizing: border-box; @@ -62,7 +70,6 @@ body { } .content .content-inner { - container: content / inline-size; max-width: var(--content-width); min-height: 100%; margin: 0 auto; diff --git a/lib/ex_doc/formatter/epub/templates/module_template.eex b/lib/ex_doc/formatter/epub/templates/module_template.eex index efd7ee521..e75ed14c5 100644 --- a/lib/ex_doc/formatter/epub/templates/module_template.eex +++ b/lib/ex_doc/formatter/epub/templates/module_template.eex @@ -1,6 +1,6 @@ <%= head_template(config, module.title) %>
moduledoc
} assert content =~ - ~r{CompiledWithDocs.Nested} + ~r{CompiledWithDocs.