logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git
commit: a99cf11819df988dff7c9049eef93dbe83d395ab
parent 92d12a2bac14913dde3ea88985e8ef597cca04e9
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  8 May 2024 21:54:00 +0200

css/mandoc.css: Provide graceful fallback from CSS variables

Diffstat:

Mbuild.ninja1+
Dcss/mandoc.css348-------------------------------------------------------------------------------
Acss/mandoc.in.css353+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 354 insertions(+), 348 deletions(-)

diff --git a/build.ninja b/build.ninja @@ -49,3 +49,4 @@ build images/linux-audio-output-current.svg: dot images/linux-audio-output-curre format = svg build css/index.css: colorscheme css/index.in.css +build css/mandoc.css: colorscheme css/mandoc.in.css diff --git a/css/mandoc.css b/css/mandoc.css @@ -1,348 +0,0 @@ -/* BEGIN css/colorscheme.css */ -:root { - /* gruvbox dark */ - --ansi00: #282828; - --ansi00-hard: #1d2021; - --ansi00-soft: #32302f; - --ansi01: #cc241d; - --ansi02: #98971a; - --ansi03: #d79921; - --ansi04: #458588; - --ansi05: #b16286; - --ansi06: #689d6a; - --ansi07: #a89984; - --ansi08: #928374; - --ansi09: #fb4934; - --ansi10: #b8bb26; - --ansi11: #fabd2f; - --ansi12: #83a598; - --ansi13: #d3869b; - --ansi14: #8ec07c; - --ansi15: #ebdbb2; -} - -@media (prefers-color-scheme: light) { - :root { - /* gruvbox light */ - --ansi00: #fbf1c7; - --ansi00-hard: #f9f5d7; - --ansi00-soft: #f2e5bc; - --ansi01: #cc241d; - --ansi02: #98971a; - --ansi03: #d79921; - --ansi04: #458588; - --ansi05: #b16286; - --ansi06: #689d6a; - --ansi07: #7c6f64; - --ansi08: #928374; - --ansi09: #9d0006; - --ansi10: #79740e; - --ansi11: #b57614; - --ansi12: #076678; - --ansi13: #8f3f71; - --ansi14: #427b58; - --ansi15: #3c3836; - } -} -/* END css/colorscheme.css */ - -a[href] { - color: var(--ansi13); -} - -a { - outline-color: invert; - outline-color: var(--ansi11); - text-decoration: underline; -} -summary { cursor: pointer; } /* for some reason this isn't in webkit */ - -body, html { - background-color: var(--ansi00-hard); - color: var(--ansi15); - margin: auto; - padding: 0; - max-width: 100ch; - font-family: sans-serif; -} - -table { - margin-top: 0; - margin-bottom: 0; - border-collapse: collapse; -} -/* Some browsers set border-color in a browser style for tbody, - * but not for table, resulting in inconsistent border styling. */ - -tbody { - border-color: inherit; -} - -tr { - border-color: inherit; -} - -td { - vertical-align: top; - padding-left: 0.2rem; - padding-right: 0.2rem; - border-color: inherit; -} - -ul, ol, dl { - margin-top: 0; - margin-bottom: 0; -} - -li, dt { - margin-top: 1rem; -} - -pre { - font-family: inherit; -} - -.permalink { - border-bottom: thin dotted; - color: inherit; - font: inherit; - text-decoration: inherit; -} - -* { - clear: both -} - -/* Header and footer lines. */ -table.head { - width: 100%; - border-bottom: 1px dotted #808080; - margin-bottom: 1rem; - font-size: smaller; -} - -td.head-vol { - text-align: center; -} - -td.head-rtitle { - text-align: right; -} - -table.foot { - width: 100%; - border-top: 1px dotted #808080; - margin-top: 1rem; - font-size: smaller; -} - -td.foot-os { - text-align: right; -} - -/* Sections and paragraphs. */ -.manual-text { - margin-left: 3.8rem; -} - -.Nd { - display: inline; -} - -h1.Sh { - margin-top: 1.2rem; - margin-bottom: 0.6rem; - margin-left: -3.2rem; -} - -h2.Ss { - margin-top: 1.2rem; - margin-bottom: 0.6rem; - margin-left: -1.2rem; -} - -.Pp { - margin: 0.6rem 0; -} - -/* Displays and lists. */ -.Bd-indent { - margin-left: 3.8rem; -} - -.Bl-bullet { - list-style-type: disc; - padding-left: 1rem; -} - -.Bl-dash { - list-style-type: none; - padding-left: 0; -} - -.Bl-dash > li:before { - content: "\2014 "; -} - -.Bl-item { - list-style-type: none; - padding-left: 0; -} - -.Bl-compact > li { - margin-top: 0; -} - -.Bl-enum { - padding-left: 2rem; -} - -.Bl-diag > dt { - font-style: normal; - font-weight: bold; -} - -.Bl-diag > dd, -.Bl-ohang > dd, -.Bl-inset > dd { - margin-left: 0; -} - -.Bl-hang > dd { - margin-left: 5.5rem; -} - -.Bl-tag { - margin-top: 0.6rem; - margin-left: 5.5rem; -} - -.Bl-tag > dt { - float: left; - margin-top: 0; - margin-left: -5.5rem; - padding-right: 0.5rem; - vertical-align: top; -} - -.Bl-tag > dd { - clear: right; - column-count: 1; - /* Force block formatting context. */ - width: 100%; - margin-top: 0; - margin-left: 0; - margin-bottom: 0.6rem; - vertical-align: top; -} - -.Bl-compact, -.Bl-compact > dt, -.Bl-compact > tbody > tr > td { - margin-top: 0; -} - -.Bl-compact > dd { - margin-bottom: 0; -} - -.Bl-column > tbody > tr > td { - margin-top: 1rem; -} - -.Rs, -.No { - font-style: normal; - font-weight: normal; -} - -.RsB, .RsI, .RsJ { - font-style: italic; - font-weight: normal; -} - -.RsT { - text-decoration: underline; -} - -.tbl td { - vertical-align: middle; -} - -.HP { - margin-left: 3.8rem; - text-indent: -3.8rem; -} - -.Fl, .Cm, .Ic, code.Nm, -code.In, .Fd, .Fn, -.Cd { - font-style: normal; - font-weight: bold; - font-family: inherit; -} - -.Ar, .Pa, .Ft, .Fa, .Vt, .Va, -.Ad, -.Em { - font-style: italic; - font-weight: normal; - color: var(--ansi10); -} - -.Op { - display: inline; -} - -.Ev, .Dv, .Er, -.Li { - font-style: normal; - font-weight: normal; - font-family: monospace; -} - -.Ms, -.Sy { - font-style: normal; - font-weight: bold; -} - -.Bf { - display: inline; -} - -.Xr { - font-style: monospace; -} - -/* Overrides to avoid excessive margins on small devices. */ -@media (max-width: 37.5rem) { - .manual-text { - margin-left: 0.5rem; - } - - h1.Sh, h2.Ss { - margin-left: 0; - } - - .Bd-indent { - margin-left: 2rem; - } - - .Bl-hang > dd { - margin-left: 2rem; - } - - .Bl-tag { - margin-left: 2rem; - } - - .Bl-tag > dt { - margin-left: -2rem; - } - - .HP { - margin-left: 2rem; - text-indent: -2rem; - } -} diff --git a/css/mandoc.in.css b/css/mandoc.in.css @@ -0,0 +1,353 @@ +/* BEGIN css/colorscheme.css */ +:root { + /* gruvbox dark */ + --ansi00: #282828; + --ansi00-hard: #1d2021; + --ansi00-soft: #32302f; + --ansi01: #cc241d; + --ansi02: #98971a; + --ansi03: #d79921; + --ansi04: #458588; + --ansi05: #b16286; + --ansi06: #689d6a; + --ansi07: #a89984; + --ansi08: #928374; + --ansi09: #fb4934; + --ansi10: #b8bb26; + --ansi11: #fabd2f; + --ansi12: #83a598; + --ansi13: #d3869b; + --ansi14: #8ec07c; + --ansi15: #ebdbb2; +} + +@media (prefers-color-scheme: light) { + :root { + /* gruvbox light */ + --ansi00: #fbf1c7; + --ansi00-hard: #f9f5d7; + --ansi00-soft: #f2e5bc; + --ansi01: #cc241d; + --ansi02: #98971a; + --ansi03: #d79921; + --ansi04: #458588; + --ansi05: #b16286; + --ansi06: #689d6a; + --ansi07: #7c6f64; + --ansi08: #928374; + --ansi09: #9d0006; + --ansi10: #79740e; + --ansi11: #b57614; + --ansi12: #076678; + --ansi13: #8f3f71; + --ansi14: #427b58; + --ansi15: #3c3836; + } +} +/* END css/colorscheme.css */ + +a[href] { + color: @ansi13@; + color: var(--ansi13); +} + +a { + outline-color: invert; + outline-color: @ansi11@; + outline-color: var(--ansi11); + text-decoration: underline; +} +summary { cursor: pointer; } /* for some reason this isn't in webkit */ + +body, html { + background-color: @ansi00-hard@; + background-color: var(--ansi00-hard); + color: @ansi15@; + color: var(--ansi15); + margin: auto; + padding: 0; + max-width: 100ch; + font-family: sans-serif; +} + +table { + margin-top: 0; + margin-bottom: 0; + border-collapse: collapse; +} +/* Some browsers set border-color in a browser style for tbody, + * but not for table, resulting in inconsistent border styling. */ + +tbody { + border-color: inherit; +} + +tr { + border-color: inherit; +} + +td { + vertical-align: top; + padding-left: 0.2rem; + padding-right: 0.2rem; + border-color: inherit; +} + +ul, ol, dl { + margin-top: 0; + margin-bottom: 0; +} + +li, dt { + margin-top: 1rem; +} + +pre { + font-family: inherit; +} + +.permalink { + border-bottom: thin dotted; + color: inherit; + font: inherit; + text-decoration: inherit; +} + +* { + clear: both +} + +/* Header and footer lines. */ +table.head { + width: 100%; + border-bottom: 1px dotted #808080; + margin-bottom: 1rem; + font-size: smaller; +} + +td.head-vol { + text-align: center; +} + +td.head-rtitle { + text-align: right; +} + +table.foot { + width: 100%; + border-top: 1px dotted #808080; + margin-top: 1rem; + font-size: smaller; +} + +td.foot-os { + text-align: right; +} + +/* Sections and paragraphs. */ +.manual-text { + margin-left: 3.8rem; +} + +.Nd { + display: inline; +} + +h1.Sh { + margin-top: 1.2rem; + margin-bottom: 0.6rem; + margin-left: -3.2rem; +} + +h2.Ss { + margin-top: 1.2rem; + margin-bottom: 0.6rem; + margin-left: -1.2rem; +} + +.Pp { + margin: 0.6rem 0; +} + +/* Displays and lists. */ +.Bd-indent { + margin-left: 3.8rem; +} + +.Bl-bullet { + list-style-type: disc; + padding-left: 1rem; +} + +.Bl-dash { + list-style-type: none; + padding-left: 0; +} + +.Bl-dash > li:before { + content: "\2014 "; +} + +.Bl-item { + list-style-type: none; + padding-left: 0; +} + +.Bl-compact > li { + margin-top: 0; +} + +.Bl-enum { + padding-left: 2rem; +} + +.Bl-diag > dt { + font-style: normal; + font-weight: bold; +} + +.Bl-diag > dd, +.Bl-ohang > dd, +.Bl-inset > dd { + margin-left: 0; +} + +.Bl-hang > dd { + margin-left: 5.5rem; +} + +.Bl-tag { + margin-top: 0.6rem; + margin-left: 5.5rem; +} + +.Bl-tag > dt { + float: left; + margin-top: 0; + margin-left: -5.5rem; + padding-right: 0.5rem; + vertical-align: top; +} + +.Bl-tag > dd { + clear: right; + column-count: 1; + /* Force block formatting context. */ + width: 100%; + margin-top: 0; + margin-left: 0; + margin-bottom: 0.6rem; + vertical-align: top; +} + +.Bl-compact, +.Bl-compact > dt, +.Bl-compact > tbody > tr > td { + margin-top: 0; +} + +.Bl-compact > dd { + margin-bottom: 0; +} + +.Bl-column > tbody > tr > td { + margin-top: 1rem; +} + +.Rs, +.No { + font-style: normal; + font-weight: normal; +} + +.RsB, .RsI, .RsJ { + font-style: italic; + font-weight: normal; +} + +.RsT { + text-decoration: underline; +} + +.tbl td { + vertical-align: middle; +} + +.HP { + margin-left: 3.8rem; + text-indent: -3.8rem; +} + +.Fl, .Cm, .Ic, code.Nm, +code.In, .Fd, .Fn, +.Cd { + font-style: normal; + font-weight: bold; + font-family: inherit; +} + +.Ar, .Pa, .Ft, .Fa, .Vt, .Va, +.Ad, +.Em { + font-style: italic; + font-weight: normal; + color: @ansi10@; + color: var(--ansi10); +} + +.Op { + display: inline; +} + +.Ev, .Dv, .Er, +.Li { + font-style: normal; + font-weight: normal; + font-family: monospace; +} + +.Ms, +.Sy { + font-style: normal; + font-weight: bold; +} + +.Bf { + display: inline; +} + +.Xr { + font-style: monospace; +} + +/* Overrides to avoid excessive margins on small devices. */ +@media (max-width: 37.5rem) { + .manual-text { + margin-left: 0.5rem; + } + + h1.Sh, h2.Ss { + margin-left: 0; + } + + .Bd-indent { + margin-left: 2rem; + } + + .Bl-hang > dd { + margin-left: 2rem; + } + + .Bl-tag { + margin-left: 2rem; + } + + .Bl-tag > dt { + margin-left: -2rem; + } + + .HP { + margin-left: 2rem; + text-indent: -2rem; + } +}