From 5dca53dc59533fb652418c58d90a2de73a1920dd Mon Sep 17 00:00:00 2001 From: MrHeadwar Date: Wed, 23 Nov 2022 16:28:03 +0100 Subject: [PATCH] Reorganized and simplified the CSS, removing a warning when building the PDF --- source/css/common.css | 36 ++-- source/css/pdf.css | 40 ++-- source/css/screen.css | 413 +++++++++++++++++++++++------------------- 3 files changed, 255 insertions(+), 234 deletions(-) diff --git a/source/css/common.css b/source/css/common.css index a606561..36b115a 100644 --- a/source/css/common.css +++ b/source/css/common.css @@ -14,8 +14,6 @@ kbd { background: linear-gradient(to top, rgb(210, 210, 210), rgb(255, 255, 255)); color: rgb(50, 50, 50); white-space: nowrap; - text-shadow: 0 0 2px rgb(255, 255, 255); - box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9); } kbd.def { @@ -23,9 +21,7 @@ kbd.def { margin-right: .2em; } -kbd.input, -kbd.cmd, -kbd.osc { +kbd.input, kbd.cmd, kbd.osc { font-family: mono; border-width: 0; text-transform: none; @@ -44,8 +40,6 @@ kbd.cmd { background: rgb(220, 220, 220); text-align: left; color: #999999; - text-shadow: none; - box-shadow: none; } kbd.cmd.lin:before { @@ -60,12 +54,9 @@ kbd.cmd.win:before { content: 'C:\\Users\\myAccount> '; } -kbd.menu, -kbd.option, -kbd.optoff { +kbd.menu, kbd.option, kbd.optoff { border-radius: 0; background: rgb(240, 240, 240); - box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4); } kbd.optoff:before { @@ -84,9 +75,7 @@ kbd.osc { text-align: left; } -kbd.fader, -kbd.knob, -kbd.button { +kbd.fader, kbd.knob, kbd.button { background: rgb(174, 174, 217); background: linear-gradient(to top, rgb(174, 174, 217), rgb(221, 221, 255)); color: #000044; @@ -118,25 +107,24 @@ samp { margin-right: .5em; } -#content dfn { +dfn { font-weight: bold; font-style: normal; } -.note, -.warning { - min-height: 1.5ex; - padding: 1em; - margin-bottom: 1em; - border-style: solid; - border-width: 1px 1px 1px 8px; -} - code { font-size: .9em; color: #555; } +.note, .warning { + min-height: 1.5ex; + padding: 1em; + margin-bottom: 1em; + border-style: solid; + border-width: 1px 1px 1px 8px; +} + .note { border-color: #e3e3e3; background-color: #f5f5f5; diff --git a/source/css/pdf.css b/source/css/pdf.css index 63d6a73..8e602c4 100644 --- a/source/css/pdf.css +++ b/source/css/pdf.css @@ -124,8 +124,8 @@ h4::before { /* subsubchapter */ } figcaption::before { - counter-increment: figurenum; - content: "Fig. " counter(chapternum) "." counter(figurenum) " - "; + counter-increment: figurenum; + content: "Fig. " counter(chapternum) "." counter(figurenum) " - "; } h1 { font-size: 2.5em; } @@ -136,32 +136,32 @@ h5 { font-size: 1.2em; } h6 { font-size: 1.1em; } h1,h2,h3,h4,h5 { - font-weight: bold; - page-break-after: avoid; - page-break-inside: avoid; - line-height: 1.25em; - color: #e4214e; + font-weight: bold; + page-break-after: avoid; + page-break-inside: avoid; + line-height: 1.25em; + color: #e4214e; } h1+p, h2+p, h3+p { - page-break-before: avoid; + page-break-before: avoid; } table { - clear: both; + clear: both; } figure { - page-break-inside: avoid; + page-break-inside: avoid; } td, th { - vertical-align: top; + vertical-align: top; } ul.toc { - white-space: nowrap; - list-style: none; + white-space: nowrap; + list-style: none; } /* create page numbers using target-counter in the TOC */ @@ -171,21 +171,21 @@ ul.toc a::after { } ul.toc li { - line-height: 2; + line-height: 2; } ul.toc li a { - text-decoration: none; + text-decoration: none; } ol { - list-style-position: inside; + list-style-position: inside; } a { - font-weight: bold; - text-decoration: none; - color: inherit; + font-weight: bold; + text-decoration: none; + color: inherit; } /* add page number to cross references */ @@ -193,7 +193,7 @@ a[href^="#"]::after { content: " (p. " target-counter(attr(href, url), page) ")"; } a[href^="http"]::after { - content: " (" attr(href) ")"; + content: " (" attr(href) ")"; } .imagemap .area {display: none;} diff --git a/source/css/screen.css b/source/css/screen.css index ac99a97..2412900 100644 --- a/source/css/screen.css +++ b/source/css/screen.css @@ -10,11 +10,234 @@ body { font-size: 16px; } +@media (max-width: 800px) { + #tree { + position: relative; + height: 250px; + width: 100%; + margin-top: 20px; + } + #content { + padding-left: 20px; + margin-top: 0px; + } +} .clear { clear:both; } +#content { + padding: 1em 2em 2ex 21em; + margin-left: 0; + line-height: 1.8em; +} + +h1, h2, h3, h4 { + font-weight: normal; + padding-bottom: .3ex; +} + +h1 { + font-size: 1.8em; + margin: 0 0 2ex 0; + padding-bottom: .8ex; + border-bottom: 2px solid #ccc; +} + +h2 { + font-size: 1.3em; + margin: 2ex 0 1ex 0; + border-bottom: 2px solid #ddd; +} + +h3 { + font-size: 1.2em; + margin: 1.5ex 0 1ex 0; + border-bottom: 1px solid #eee; +} + +h4 { + font-size: 1.1em; + margin: 1.5ex 0 .5ex 0; + border-bottom: 1px solid #eee; +} + +table { + width:100%; + margin: 1em 0; + padding: 0; + font-weight: normal; + text-align: left; +} + +table tr { + border-bottom: 2px solid #eeeeee; +} + +table tr:nth-child(odd){ + background-color: white; +} + +table tr:nth-child(even){ + background-color: #f5f5f5; +} + +table tr:hover { + background-color: #F2F9FF; +} + +table td, table th { + margin: 0; + padding: .5em; +} + +table th { + font-weight: bold; +} + +table th.sub1 { + padding-left: 2em; +} + +table th.sub2 { + padding-left: 4em; +} + +table thead { + font-weight:bold; +} + +table.dl th { + /* dl class (definition list) is for 2-columns tables that describe properties: + maximmizes the width of the 2nd (description) column */ + vertical-align: top; + min-width: 20%; + white-space:nowrap +} + +table.dl td { + vertical-align: top; + width: 100%; +} + +ul, ol { + overflow: hidden; +} + +figure { + display: table; +} + +figcaption { + display: table-caption; + caption-side: bottom; + font-style: italic; + padding-top: 0.4em; + padding-bottom: 1em; + font-size: .9em; + line-height: .9em; +} + +figcaption.center { + text-align: center; +} + +figcaption.titleover { + text-align: center; + caption-side: top; +} + +figure.right { + margin: 0 0 1em 1em; + float: right; + clear: right; +} + +figure.left { + margin: 0 1em 1em 0; + float: left; + clear: left; +} + +figure.center { + margin: 1em auto 1em auto; + clear: both; +} + +img.mini { + width: 200px; +} + +img.mini:hover { + width: 100%; +} + +img.fit { + width: 100%; +} + +p.center { + text-align:center; +} + +kbd { + text-shadow: 0 0 2px rgb(255, 255, 255); + box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9); +} + +kbd.cmd { + text-shadow: none; + box-shadow: none; +} + +kbd.menu, +kbd.option, +kbd.optoff { + box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4); +} + +.imagemap { + position: relative; +} + +.imagemap img { + display: block; +} + +.imagemap .area { + display: block; + position: absolute; + transition: box-shadow 0.15s ease-in-out; +} + +.imagemap .area:hover { + box-shadow: 0px 0px 1vw white; +} + +/* for the TOC */ +p.chapter, p.subchapter, p.section, p.subsection { + line-height:1em; + padding-left: 1em; +} + +p.chapter { + padding-top: 1em; + padding-bottom:1em; +} + +p.subchapter { + padding-left: 4em; +} + +p.section { + padding-left: 6em; +} + +p.subsection { + padding-left: 8em; +} + #tree { background-color: #212A30; line-height: 1.8ex; @@ -56,193 +279,3 @@ body { display: inline; color: #FF8080; } - -#content { - padding: 1em 2em 2ex 21em; - margin-left: 0; - line-height: 1.8em; -} - -#content h1, -#content h2, -#content h3, -#content h4 { - font-weight: normal; - padding-bottom: .3ex; -} - -#content h1 { - font-size: 1.8em; - margin: 0 0 2ex 0; - padding-bottom: .8ex; - border-bottom: 2px solid #ccc; -} - -#content h2 { - font-size: 1.3em; - margin: 2ex 0 1ex 0; - border-bottom: 2px solid #ddd; -} - -#content h3 { - font-size: 1.2em; - margin: 1.5ex 0 1ex 0; - border-bottom: 1px solid #eee; -} - -#content h4 { - font-size: 1.1em; - margin: 1.5ex 0 .5ex 0; - border-bottom: 1px solid #eee; -} - -#content table { - width:100%; - margin: 1em 0; - padding: 0; - font-weight: normal; - text-align: left; -} - -#content table tr { - border-bottom: 2px solid #eeeeee; -} - -#content table tr:nth-child(odd){ - background-color: white; -} - -#content table tr:nth-child(even){ - background-color: #f5f5f5; -} - -#content table tr:hover { - background-color: #F2F9FF; -} - -#content table td, -#content table th { - margin: 0; - padding: .5em; -} - -#content table th { - font-weight: bold; -} - -#content table th.sub1 { - padding-left: 2em; -} - -#content table th.sub2 { - padding-left: 4em; -} - -#content table thead { - font-weight:bold; -} - -#content table.dl th { - /* dl class (definition list) is for 2-columns tables that describe properties: - maximmizes the width of the 2nd (description) column */ - vertical-align: top; - min-width: 20%; - white-space:nowrap -} - -#content table.dl td { - vertical-align: top; - width: 100%; -} - -#content ul, -#content ol { - overflow: hidden; -} - -#content figure { - display: table; -} - -#content figcaption { - display: table-caption; - caption-side: bottom; - font-style: italic; - padding-top: 0.4em; - padding-bottom: 1em; - font-size: .9em; - line-height: .9em; -} - -#content figcaption.center { - text-align: center; -} - -#content figcaption.titleover { - text-align: center; - caption-side: top; -} - -#content figure.right { - margin: 0 0 1em 1em; - float: right; - clear: right; -} - -#content figure.left { - margin: 0 1em 1em 0; - float: left; - clear: left; -} - -#content figure.center { - margin: 1em auto 1em auto; - clear: both; -} - -#content img.mini { - width: 200px; -} - -#content img.mini:hover { - width: 100%; -} - -#content img.fit { - width: 100%; -} - -#content p.center { - text-align:center; -} - -@media (max-width: 800px) { - #tree { - position: relative; - height: 250px; - width: 100%; - margin-top: 20px; - } - #content { - padding-left: 20px; - margin-top: 0px; - } -} - -.imagemap {position: relative;} -.imagemap img {display: block;} -.imagemap .area {display: block; position: absolute; transition: box-shadow 0.15s ease-in-out;} -.imagemap .area:hover {box-shadow: 0px 0px 1vw white;} - -/* for the TOC */ -#content p.chapter, -#content p.subchapter, -#content p.section, -#content p.subsection { - line-height:1em; -} -#content p.chapter { padding-top: 1em; padding-left: 1em; padding-bottom:1em; } -#content p.subchapter { padding-left: 4em; } -#content p.section { padding-left: 6em; } -#content p.subsection { padding-left: 8em; } -