Appearance
Styles
A .press file's top-level <styles> element contains the style rules used by the document.
A style rule can either apply to an element directly by using the element's tag name, or can be used to create an alias to be applied to whichever styles you wish.
A style rule contains a list of attribute assignments, using the syntax <attribute-name>attribute-value</attribute-name> and sub style rules using the syntax <child name="...">...</child> where the child's name attribute must reference an existing element or alias.
Sub-Rules
A style rule's sub-rules apply to all children of an element within "scope" of the original rule. For example the following
xml
<styles>
<p>
<child name="b">
<font-size>16pt</font-size>
</child>
</p>
</styles>states that any b tag which is a descendant of a p tag should have a font size of 16pt.
Aliases
Aliases can be created at the top level of the <styles> element with the syntax <alias name="...">...</alias>. An alias can be applied to an element using the attribute style="@alias-name". Multiple aliases can be applied to the same element like so style="@alias-one; @alias-two".
For example, if the following alias exists in <styles>
xml
<alias name="blue-italic">
<font-color>blue</font-color>
<font-style>italic</font-style>
</alias>then the paragraph below would inherit the alias' attributes
xml
<p style="@blue-italic">
...
</p>Aliases can have sub-rules (using a <child> declaration).
In Place Attribute Assignments
A given element's XML attributes can be used to override the <styles> collection. For example,
xml
<p font-size="14pt">
Example text.
</p>For simplicity, an element's style attribute can be used to list multiple assignments sequentially. For example,
xml
<p style="font-size=14pt; background-color=blue">
Example text.
</p>Colors
Any style property which represents a color (e.g. background-color, font-color etc.) can accept any valid CSS color, such as:
- Hexadecimal: #d5fe89
- RGB: rgb(45, 189, 237)
- RGBA: rgb(45, 189, 237, 0.3)
- HSL: hsl(330, 65%, 60%)