/*
 * Copyright (c) 2007-2010 Pixware SARL. All rights reserved.
 *
 * This file is part of the XMLmind XML Editor project.
 * For conditions of distribution and use, see the accompanying legal.txt file.
 */

@extension "com.xmlmind.xmleditext.mathml.StyleSheetExtension";

@namespace mml url(http://www.w3.org/1998/Math/MathML);
@namespace xlink url(http://www.w3.org/1999/xlink);
@namespace om url(http://www.openmath.org/OpenMath);

mml|*,
om|* {
    display: tree;
}

mml|*:comment,
mml|*:processing-instruction {
    display: none;
}

/*
 * Utility empty elements
 */

@property-value footprint-color() #D0D0D0;

mml|none {
    display: inline;
    content: icon(square);
    color: footprint-color();
}

mml|mprescripts {
    display: inline;
    content: icon(hollow-diamond);
    color: footprint-color();
}

/*
 * Empty alignment elements
 */

mml|malignmark,
mml|maligngroup {
    display: inline;
    content: gadget("com.xmlmind.xmleditext.mathml.MathGadgetFactory");
    color: footprint-color();
}

/*
 * Empty presentation token elements
 */

mml|mglyph,
mml|mspace {
    display: inline;
    content: gadget("com.xmlmind.xmleditext.mathml.MathGadgetFactory");
}

mml|mspace {
    color: footprint-color();
}

/*
 * Non-empty presentation token elements
 */

mml|mi,
mml|mn,
mml|mo,
mml|mtext,
mml|ms {
    /* Inline-block-like */
    display: view("com.xmlmind.xmleditext.mathml.MathElementViewFactory");
}

/*
 * Other presentation elements
 */

mml|mrow,
mml|mstyle,
mml|merror,
mml|mphantom,
mml|mpadded,
mml|maction,
mml|mfrac,
mml|msub,
mml|msup,
mml|msubsup,
mml|mmultiscripts,
mml|munder,
mml|mover,
mml|munderover,
mml|mroot,
mml|msqrt,
mml|menclose,
mml|mfenced,
mml|mtd,
mml|mtr,
mml|mlabeledtr,
mml|mtable {
    /* Block-like */
    display: view("com.xmlmind.xmleditext.mathml.MathElementViewFactory");
}

mml|merror {
    color: red;
}

mml|mphantom {
    color: footprint-color();
}

mml|menclose {
    /* Not the actual CSS box padding: the amount of space between 
       content and decor. */
    padding: 1;
}

mml|menclose[notation~=box],
mml|menclose[notation~=roundedbox],
mml|menclose[notation~=circle] {
    padding: .5ex .4em;
}

/*
 * Top-level math element
 */

mml|math {
    /* Div-like */
    display: view("com.xmlmind.xmleditext.mathml.MathElementViewFactory");
    font-family: "MathML normal";
    /* Makes math easier to read on screen */
    font-size: larger;
}

mml|semantics,
mml|annotation,
mml|annotation-xml {
    display: block;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

mml|annotation,
mml|annotation-xml {
    background-color: #EEEEEE;
    border: thin solid gray;
    padding: 2px;
}

mml|annotation[encoding],
mml|annotation-xml[encoding] {
    margin-top: 0;
}

mml|annotation[encoding]:before,
mml|annotation-xml[encoding]:before {
    display: block;
    content: attr(encoding);
    color: gray;
    font-family: sans-serif;
    font-weight: bold;
    margin-top: 1.33ex;
    margin-bottom: 0.5ex;
}

/*
 * When printing
 */

@media print {
    mml|malignmark,
    mml|maligngroup,
    mml|mspace,
    mml|mphantom {
        color: white;
    }

    mml|none,
    mml|mprescripts {
        content: icon(invisible);
        color: white;
    }
}
