1. Built-in CSS rules
Prev | Chapter 4. Other extensions | Next

## 1. Built-in CSS rules

XMLmind XML Editor has built-in CSS rules mainly used to style comments and processing instructions. These built-in rules are always implicitly loaded before the rules found in a CSS file. However, nothing prevents you from overriding any of the following built-in rules.

    /*
     * Copyright (c) 2004-2013 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.
     *
     * Built-in CSS rules.
     */

    /* ------------------------------------------------------------------------
       Comments and processing-instructions
       ------------------------------------------------------------------------ */

    *::comment,
    *::processing-instruction {
        display: inherit;
        white-space: pre;
        text-align: left;
        font-family: monospace;
        font-style: normal;
        font-weight: normal;
        font-size: small;
        margin: 0.25ex;
    }

    *::comment {
        background-color: #FFFFCC;
        color: #808000;
    }

    *::processing-instruction {
        background-color: #CCFFCC;
        color: #008000;
    }

    /* ------------------------------------------------------------------------
       Remark
       ------------------------------------------------------------------------ */

    *::processing-instruction(xxe-remark) {
        display: inline;
        content: gadget("com.xmlmind.xmleditapp.cmd.diff.RemarkIndicator");
        font-size: inherit;
        background-color: transparent;
    }

    /* ------------------------------------------------------------------------
       Spreadsheet
       ------------------------------------------------------------------------ */

    *::processing-instruction(xxe-formula) {
        display: inline;
        content: gadget("com.xmlmind.xmleditapp.cmd.spreadsheet.Formula");
        background-color: transparent;
    }

    /* ------------------------------------------------------------------------
       Nodes marked read-only
       ------------------------------------------------------------------------ */

    @namespace prop "http://www.xmlmind.com/xmleditor/namespace/property";

    *:property(prop|readOnly, "true") {
        background-color: #E0F0F0;
    }

    *:property(prop|readOnly, "false") {
        background-color: normal;
    }

    /* ------------------------------------------------------------------------
       XInclude directive
       ------------------------------------------------------------------------ */

    @namespace xi url(http://www.w3.org/2001/XInclude);

    @property-value xi-include-content()
        paragraph(content(icon(pop-se), " ", element-name(),
                          " href=", attr(href),
                          " xpointer=", attr(xpointer)));

    /* The xpointer attribute must not be present when parse="text" */

    @property-value xi-text-include-content()
        paragraph(content(icon(pop-se), " ", element-name(),
                          " href=", attr(href),
                          " parse=", attr(parse),
                          " encoding=", attr(encoding)));

    xi|include {
        display: block;
        margin-bottom: 1.33ex;
    }

    xi|include:before {
        display: block;
        content: xi-include-content();
        font-style: italic;
        color: gray;
        margin-top: 1.33ex;
    }

    xi|include[parse=text]:before {
        content: xi-text-include-content();
    }

    xi|include:empty {
        display: inherit;
        content: xi-include-content();
        font-style: italic;
        color: gray;
    }

    xi|include:empty:before {
        content: "";
    }

    xi|include[parse=text]:empty {
        content: xi-text-include-content();
    }

    xi|include[parse=text]:empty:before {
        content: "";
    }

    xi|fallback {
        display: block;
        font-family: normal;
        font-size: medium;
        font-weight: normal;
        font-style: normal;
        background-color: normal;
        color: normal;
        padding: 0.5ex;
        border: 1px dotted gray;
        margin: 0.5ex;
    }

    /* ------------------------------------------------------------------------
       When printing
       ------------------------------------------------------------------------ */

    @media print {
        * {
            line-height: 1.2;
        }

        *::comment,
        *::processing-instruction,
        *::processing-instruction(xxe-formula) {
            display: none;
        }

        *:property(prop|readOnly) {
            background-color: transparent;
        }
    }

In practice, this just means that you have nothing special to do to style nodes marked as being read-only, XIncludes, comments, processing instructions and spreadsheet formulas (processing instruction `xxe-formula`).

Prev | Up | Next
Chapter 4. Other extensions | Home | 2. CSS3 selectors