From 070ca2eb3c21fe098da1f0d059bc3e6f0b64b16c Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 24 Feb 2024 18:33:47 -0500 Subject: assets/css: Namespace MathML Normalise. Generated math should not have inline styles --- assets/css/default-mathml.css | 26 ++++++++++++++++++++++++++ assets/css/default.css | 6 ------ content/canory/messages/math.md | 21 ++++++--------------- themes/default/layouts/partials/head-css.html | 13 +++++++++---- 4 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 assets/css/default-mathml.css diff --git a/assets/css/default-mathml.css b/assets/css/default-mathml.css new file mode 100644 index 0000000..4aa437a --- /dev/null +++ b/assets/css/default-mathml.css @@ -0,0 +1,26 @@ +@namespace mathml url(http://www.w3.org/1998/Math/MathML); + +mathml|math { + display: block; + display: block math; +} + +mathml|mtd { + display: flex; + justify-content: center; + padding-right: 0.4em; + padding-left: 0.4em; + padding-bottom: 0.5rem; + padding-top: 0.5rem; +} + +@-moz-document url-prefix() { + mathml|mtd { + display: flex; + justify-content: center; + padding-right: 0.4em; + padding-left: 0.4em; + padding-bottom: 0.5ex; + padding-top: 0.5ex; + } +} diff --git a/assets/css/default.css b/assets/css/default.css index cfb99a2..89ad378 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -2287,12 +2287,6 @@ link-card article a { display: block; } -math-ml, -math-ml math { - display: block; - display: block math; -} - math-ml:not(:last-child) { margin-bottom: 0.75rem; } diff --git a/content/canory/messages/math.md b/content/canory/messages/math.md index a3fca43..cd02f88 100644 --- a/content/canory/messages/math.md +++ b/content/canory/messages/math.md @@ -11,7 +11,7 @@ _à la_ generality. - + 0 = @@ -22,7 +22,7 @@ _à la_ generality. - + 0 = @@ -33,7 +33,7 @@ _à la_ generality. - + 0 = @@ -51,10 +51,7 @@ _à la_ generality. - - - - + 0 = @@ -63,10 +60,7 @@ _à la_ generality. - - - - + 0 × @@ -86,10 +80,7 @@ _à la_ generality. - - - - + 1 = diff --git a/themes/default/layouts/partials/head-css.html b/themes/default/layouts/partials/head-css.html index 423db0c..6e9eb56 100644 --- a/themes/default/layouts/partials/head-css.html +++ b/themes/default/layouts/partials/head-css.html @@ -2,12 +2,15 @@ {{- $syntax := resources.Get "css/default-syntax.css" -}} {{- $simple := resources.Get "css/default-simple.css" -}} {{- $fast := resources.Get "css/default-fast.css" -}} +{{- $math := resources.Get "css/default-mathml.css" -}} {{- $css := - slice $default $syntax | - resources.Concat "css/bundle.css" | - resources.Minify | - fingerprint | + slice + $default + $syntax + | resources.Concat "css/bundle.css" + | resources.Minify + | fingerprint -}} {{ if .Site.Params.site.production }} @@ -17,5 +20,7 @@ {{ end }} + + -- cgit v1.2.3