aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2024-02-24 18:33:47 -0500
committertdro <tdro@noreply.example.com>2024-02-24 18:33:47 -0500
commit070ca2eb3c21fe098da1f0d059bc3e6f0b64b16c (patch)
tree99faebe7bb300e96b35f62b57f727bf5a88bb111
parentb9738b3feb929b6e3cfbdd3732ffb690f70c46ff (diff)
downloadcanory-070ca2eb3c21fe098da1f0d059bc3e6f0b64b16c.tar.gz
canory-070ca2eb3c21fe098da1f0d059bc3e6f0b64b16c.tar.bz2
canory-070ca2eb3c21fe098da1f0d059bc3e6f0b64b16c.zip
assets/css: Namespace MathML
Normalise. Generated math should not have inline styles
-rw-r--r--assets/css/default-mathml.css26
-rw-r--r--assets/css/default.css6
-rw-r--r--content/canory/messages/math.md21
-rw-r--r--themes/default/layouts/partials/head-css.html13
4 files changed, 41 insertions, 25 deletions
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 @@ _&agrave; la_ generality.
<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="\begin{align*} & 0 = 0 \times 1\\ & 0 = 0 \times 2\\ & 0 = 0 \times 3 \end{align*}" display="block" >
<mtable displaystyle="true" columnalign="right">
<mtr>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
+ <mtd>
<mrow>
<mn>0</mn>
<mo>=</mo>
@@ -22,7 +22,7 @@ _&agrave; la_ generality.
</mtd>
</mtr>
<mtr>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
+ <mtd>
<mrow>
<mn>0</mn>
<mo>=</mo>
@@ -33,7 +33,7 @@ _&agrave; la_ generality.
</mtd>
</mtr>
<mtr>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
+ <mtd>
<mrow>
<mn>0</mn>
<mo>=</mo>
@@ -51,10 +51,7 @@ _&agrave; la_ generality.
<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="\begin{align*} & 0 = 0\\ & 0 \times 1 = 0 \times 3 \end{align*}" display="block">
<mtable displaystyle="true" columnalign="right left">
<mtr>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
- <mrow></mrow>
- </mtd>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;display:flex;justify-content:center;">
+ <mtd>
<mrow>
<mn>0</mn>
<mo>=</mo>
@@ -63,10 +60,7 @@ _&agrave; la_ generality.
</mtd>
</mtr>
<mtr>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
- <mrow></mrow>
- </mtd>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
+ <mtd>
<mrow>
<mn>0</mn>
<mo>×</mo>
@@ -86,10 +80,7 @@ _&agrave; la_ generality.
<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="\begin{align*} & 1 = 3 \end{align*}" display="block">
<mtable displaystyle="true" columnalign="right left">
<mtr>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
- <mrow></mrow>
- </mtd>
- <mtd style="padding:0.7ex 0em 0.7ex 0em;">
+ <mtd>
<mrow>
<mn>1</mn>
<mo>=</mo>
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 @@
<link rel="stylesheet" href="{{ $syntax.Permalink }}" />
{{ end }}
+<link rel="stylesheet" href="{{ $math.Permalink }}" />
+
<link rel="alternate stylesheet" href="{{ $simple.Permalink }}" />
<link rel="alternate stylesheet" href="{{ $fast.Permalink }}" />