mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 15:44:33 +00:00
382454a979
Currently, the PNG fallback is hidden in the MathML mode and the MathML & SVG are respectively hidden and visible by default; the visibility of the SVG/MathML output is only changed for Gecko. This does not work well for IE < 9, which does not support SVG. This commit tries to improve the selection of PNG, SVG or MathML according to the browser capatibility. Change-Id: Ie9b0fdb66c51fbf6be98df092ce4de29fbba6068
55 lines
2.4 KiB
CSS
55 lines
2.4 KiB
CSS
/*
|
|
Document : ext.math
|
|
Created on : 23.09.2013, 13:55:00
|
|
Author : Physikerwelt (Moritz Schubotz)
|
|
Description:
|
|
Shows browser-dependent math output.
|
|
*/
|
|
|
|
/* Default style for MathML. */
|
|
.mwe-math-mathml-inline { display: none; }
|
|
.mwe-math-mathml-display { display: none; margin-left: auto; margin-right: auto; }
|
|
@namespace m url('http://www.w3.org/1998/Math/MathML');
|
|
m|math {
|
|
/* Try OpenType MATH fonts, the WOFF fallback and the old math fonts */
|
|
font-family: Cambria Math, Latin Modern Math, STIX Math, LatinModernMathWOFF, MathJax_Main, STIXGeneral, serif;
|
|
}
|
|
@font-face {
|
|
/* WOFF version of Latin Modern Math.
|
|
See https://github.com/fred-wang/MathFonts */
|
|
font-family: LatinModernMathWOFF;
|
|
src: url(./LatinModern/latinmodern-math.woff);
|
|
}
|
|
|
|
/* Default style for SVG. */
|
|
img.mwe-math-fallback-svg-inline { display: none; }
|
|
img.mwe-math-fallback-svg-display { display: none; margin-left: auto; margin-right: auto; }
|
|
|
|
/* Default style for the PNG fallback. */
|
|
img.mwe-math-fallback-png-inline { display: inline; vertical-align: middle; }
|
|
img.mwe-math-fallback-png-display { display: block; }
|
|
|
|
/* Default style for the source fallback. */
|
|
.mwe-math-fallback-source-inline { display: inline; vertical-align: middle; }
|
|
.mwe-math-fallback-source-display { display: block; margin-left: auto; margin-right: auto; }
|
|
|
|
/******************************************************************************/
|
|
/* Browser-specific hacks are bad but let's use that for now...
|
|
See http://browserhacks.com/ */
|
|
|
|
/* For all browsers but IE < 9, hide the PNG fallback and show the SVG instead.
|
|
We override the default style for PNG and SVG above */
|
|
:root * > img.mwe-math-fallback-svg-inline { display: inline; }
|
|
:root * > img.mwe-math-fallback-svg-display { display: block; }
|
|
:root * > img.mwe-math-fallback-svg-inline + img.mwe-math-fallback-png-inline,
|
|
:root * > img.mwe-math-fallback-svg-display + img.mwe-math-fallback-png-display { display: none; }
|
|
|
|
@-moz-document url-prefix() {
|
|
/* For Gecko browsers, hide the SVG fallback and show the MathML instead.
|
|
We override the style for SVG and MathML above */
|
|
.mwe-math-mathml-inline { display: inline; }
|
|
.mwe-math-mathml-display { display: block; }
|
|
:root * > .mwe-math-mathml-inline + img.mwe-math-fallback-svg-inline,
|
|
:root * > .mwe-math-mathml-display + img.mwe-math-fallback-svg-display { display: none; }
|
|
}
|