/*
* The default style sheet used to render MathML.
*
* Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@namespace url(http://www.w3.org/1998/Math/MathML);
/* Universal rules */
* {
font-size: math;
display: block math;
writing-mode: horizontal-tb !important;
}
/* The <math> element */
math {
direction: ltr;
text-indent: 0;
letter-spacing: normal;
line-height: normal;
word-spacing: normal;
font-family: math;
font-size: inherit;
font-style: normal;
font-weight: normal;
display: inline math;
math-shift: normal;
math-style: compact;
math-depth: 0;
}
math[display="block" i] {
display: block math;
math-style: normal;
}
math[display="inline" i] {
display: inline math;
math-style: compact;
}
:focus {
outline: auto 1px -webkit-focus-ring-color;
}
/* <mrow>-like elements */
semantics > :not(:first-child) {
display: none;
}
maction > :not(:first-child) {
display: none;
}
merror {
border: 1px solid red;
background-color: lightYellow;
}
mphantom {
visibility: hidden;
}
/* Token elements */
mi {
text-transform: math-auto;
}
/* Tables */
mtable {
display: inline-table;
math-style: compact;
}
mtr {
display: table-row;
}
mtd {
display: table-cell;
/* Centering inside table cells should rely on box alignment properties.
See https://github.com/w3c/mathml-core/issues/156 */
text-align: -webkit-center;
padding: 0.5ex 0.4em;
}
/* Fractions */
mfrac {
padding-inline-start: 1px;
padding-inline-end: 1px;
}
mfrac > * {
math-depth: auto-add;
math-style: compact;
}
mfrac > :nth-child(2) {
math-shift: compact;
}
/* Other rules for scriptlevel, displaystyle and math-shift */
mroot > :not(:first-child) {
math-depth: add(2);
math-style: compact;
}
mroot, msqrt {
math-shift: compact;
}
msub > :not(:first-child),
msup > :not(:first-child),
msubsup > :not(:first-child),
mmultiscripts > :not(:first-child),
munder > :not(:first-child),
mover > :not(:first-child),
munderover > :not(:first-child) {
math-depth: add(1);
math-style: compact;
}
munder[accentunder="true" i] > :nth-child(2),
mover[accent="true" i] > :nth-child(2),
munderover[accentunder="true" i] > :nth-child(2),
munderover[accent="true" i] > :nth-child(3) {
font-size: inherit;
}
msub > :nth-child(2),
msubsup > :nth-child(2),
mmultiscripts > :nth-child(even),
mmultiscripts > mprescripts ~ :nth-child(odd),
mover[accent="true" i] > :first-child,
munderover[accent="true" i] > :first-child {
math-shift: compact;
}
mmultiscripts > mprescripts ~ :nth-child(even) {
math-shift: inherit;
}