mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
feat(MathJax): add dark mode adaptation for MathJax rendering
This commit is contained in:
@@ -117,3 +117,23 @@ U \ar@/_/[ddr]_y \ar@{.>}[dr]|{\langle x,y \rangle} \ar@/^/[drr]^x \\
|
||||
}
|
||||
\end{xy}
|
||||
$$
|
||||
|
||||
## More
|
||||
|
||||
### Dark Mode Adaptation
|
||||
|
||||
Use `.auto-dark-mode` class to automatically adapt to dark mode by inverting the color and hue:
|
||||
|
||||
For inline formula:
|
||||
|
||||
$\bbox[border: solid .4pt magenta, pink]{x^2=4}$
|
||||
{.auto-dark-mode}
|
||||
|
||||
For formula blocks:
|
||||
|
||||
{{< style "[data-theme=dark] & { filter: invert(1) hue-rotate(0.5turn); }" >}}
|
||||
$$
|
||||
\bbox[border: solid .4pt magenta, pink]{x^2=4}
|
||||
$$
|
||||
{.auto-dark-mode}
|
||||
{{< /style >}}
|
||||
|
||||
@@ -58,3 +58,10 @@
|
||||
.rounded-full {
|
||||
@include border-radius(full);
|
||||
}
|
||||
|
||||
// auto adapt to dark mode by inverting the color and hue
|
||||
.auto-dark-mode {
|
||||
[data-theme=dark] & {
|
||||
filter: invert(1) hue-rotate(0.5turn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,10 +467,13 @@
|
||||
}
|
||||
|
||||
// MathJax styles
|
||||
mjx-container[jax='CHTML'][display='true'] {
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
mjx-container[jax='CHTML'] {
|
||||
// formula Blocks
|
||||
&[display='true'] {
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
// fix the color of xypic diagrams
|
||||
mjx-xypic {
|
||||
|
||||
Reference in New Issue
Block a user