Chapter 8. Stylesheet Property Reference

1. CSS2 properties
1.1. font-family
1.2. font-size
1.3. color
1.4. border-top-width, border-right-width, border-bottom-width, border-left-width
1.5. border-top-color, border-right-color, border-bottom-color, border-left-color
1.6. border-top-style, border-right-style, border-bottom-style, border-left-style
1.7. text-align
1.8. text-indent
1.9. list-style-type
1.10. width, height
1.11. margin-left, margin-top, margin-right, margin-bottom
1.12. padding-left, padding-top, padding-right, padding-bottom
1.13. text-decoration
1.14. text-underline-style
1.15. text-underline-mode
1.16. font-variant
1.17. font-weight
1.18. text-transform
1.19. line-height
1.20. vertical-align
1.21. font-style
1.22. background-color
1.23. widows, orphans
1.24. page-break-inside, page-break-after
1.25. page-break-before
1.26. page
1.27. word-break-inside
1.28. border-spacing
1.29. float
1.30. position
1.31. top, left, right, bottom
1.32. clear
2. Custom Properties
2.1. -ilx-list-group
2.2. -ilx-marker-format
2.3. -ilx-marker-offset
2.4. -ilx-marker-align
2.5. -ilx-marker-follow
2.6. -ilx-header-offset, -ilx-footer-offset
2.7. -ilx-paragraph-outline-level
2.8. -ilx-reference-presentation-type
2.9. -ilx-default-font-family
2.10. -ilx-footnote-style-type
2.11. -ilx-footnote-numbering-policy
2.12. -ilx-footnote-position
2.13. -ilx-tab-stops
2.14. -ilx-image-source

1. CSS2 properties

This section lists all properties that are borrowed from the CSS2 specification. Since the specification describes the semantics and values of the properties better and more precise than we probably can, we only list the supported properties at this place and would like to refer you to the CSS2 specification for details.

We'll add comments only for notable differences in the way downCast implements the respective property.

Note

Please note that in several situations, the property's semantics cannot be fully implemented due to limitations that the RTF output format imposes. downCast tries to achieve the best approximation possible in these cases.

Important

  • The property value auto is not supported except where explicitly stated.

  • Properties which take a length value must specify a unit, even when the length is 0.

  • CSS2 shorthand properties are supported.

  • For calculating absolute values from length specifications using px units, a value of 96ppi is assumed.

1.1. font-family

Sets the font family, i.e. the font name. This property sets RTF font properties based on a predefined internal config file, stdfonts.config.

(view CSS2 description)

1.2. font-size

Sets the font size.

(view CSS2 description)

1.3. color

Sets the text color.

(view CSS2 description)

1.4. border-top-width, border-right-width, border-bottom-width, border-left-width

Sets the width of the border.

Note

Can be applied to elements table, cell, par, inline

(view CSS2 description)

1.5. border-top-color, border-right-color, border-bottom-color, border-left-color

Sets the color of the border.

Note

Can be applied to elements table, cell, par, inline

(view CSS2 description)

1.6. border-top-style, border-right-style, border-bottom-style, border-left-style

Sets the border style.

Supported values: none, dotted, dashed, solid, double, groove, ridge, inset, outset

Note

Can be applied to elements table, cell, par, inline

(view CSS2 description)

1.7. text-align

Horizontal text alignment.

Note

Can be applied to element par, heading

(view CSS2 description)

1.8. text-indent

First line indent. Can be positive or negative.

Note

Can be applied to element par, heading

(view CSS2 description)

1.9. list-style-type

List marker numbering style.

Supported values: disc, circle, decimal, decimal-leading-zero, lower-roman, upper-roman, lower-alpha, lower-latin, upper-alpha, upper-latin, hebrew, cjk-ideographic, katakana, katakana-iroha, none

Note

Can be applied to element list, heading

(view CSS2 description)

1.10. width, height

Width resp. height of an element.

Note

Can be applied to elements image, document, textbox, cell

(view CSS2 description)

1.11. margin-left, margin-top, margin-right, margin-bottom

Margin of an element.

Note

The value auto is only supported on the table element for left-, right-aligning or centering a table with respect to the containing column.

Note

Can be applied to elements par, inline, cell, textbox, table

(view CSS2 description)

1.12. padding-left, padding-top, padding-right, padding-bottom

Padding of an element.

Note

The value auto is only supported on the table element for left-, right-aligning or centering a table with respect to the containing column.

Note

Can be applied to elements par, inline, cell, textbox, table, but not to row

(view CSS2 description)

1.13. text-decoration

Additional text property.

Values: line-through, none, underline

(view CSS2 description)

1.14. text-underline-style

Text underline style.

Supported values:none, solid, double, dotted, thick, dashed, dot-dash, dot-dot-dash, wave

Warning

This property is taken from the CSS3 draft, which may change in the future. Use with caution!

(view CSS3 draft description; link may be unstable)

1.15. text-underline-mode

Text underline mode.

Supported values:continuous, words

Warning

This property is taken from the CSS3 draft, which may change in the future. Use with caution!

(view CSS3 draft description; link may be unstable)

1.16. font-variant

Variation of the font.

Supported values: normal, small-caps

(view CSS2 description)

1.17. font-weight

Sets font weight.

Supported values: normal, lighter, 100, 200, 300, 400, 500, 600, bold, bolder, 700, 800, 900

Note

Starting from bold in the value enumeration above, the property is translated to "bold text". All other values turn bold off.

(view CSS2 description)

1.18. text-transform

Turns text into capitals.

Value: uppercase

(view CSS2 description)

1.19. line-height

Specifies the minimal line height.

(view CSS2 description)

1.20. vertical-align

Sets vertical alignment.

Supported values on the cell element: top, middle, bottom

Supported values on the inline element: baseline, sub, super

(view CSS2 description)

1.21. font-style

Sets the font style.

Supported values: normal, italic, oblique

Note

Values italic and oblique are both translated to the same RTF symbol, \i.

(view CSS2 description)

1.22. background-color

Sets the background color.

Note

Supported on elements par and cell.

(view CSS2 description)

1.23. widows, orphans

Widow/orphan control for calculating page breaks.

Note

Only values 0 (=off) or 2 (=on) are supported. orphans and widows can not be set independently.

(view CSS2 description)

1.24. page-break-inside, page-break-after

Allows or suppresses page breaks inside or after an element.

Supported values: auto, avoid

Note

Supported on element par.

(view CSS2 description)

1.25. page-break-before

Controls page break algorithm.

Supported values: auto, always, left, right

Note

Supported on element part.

(view CSS2 description)

1.26. page

Selects a named @page rule to be applied.

Note

Supported on element part only.

(view CSS2 description)

1.27. word-break-inside

Provides hyphenation control.

Supported values: normal, hyphenate

Note

A value of normal suppresses hyphenation as far as possible.

(view CSS3 draft description; link may be unstable)

1.28. border-spacing

Specifies the spacing between borders of table cells.

Note

Supported on element table.

(view CSS2 description)

1.29. float

Specifies that an element should be floating to the left or right border or in the center of the current column.

Note

Supported on elements image, par and textbox.

Warning

Due to limitations of the destination format RTF, this property is not fully supported.

(view CSS2 description)

1.30. position

Specifies whether an element should be in the flow or positioned at a fixed location.

Supported values: static, absolute, fixed

Note

Supported on element textbox.

Warning

Due to limitations of the destination format RTF, this property is not fully supported.

(view CSS2 description)

1.31. top, left, right, bottom

Specifies displacement of an element.

Note

Supported on element textbox.

Warning

Due to limitations of the destination format RTF, this property can not be supported exactly as described in the CSS2 specification.

1.32. clear

Specifies whether an element should be clear of floats.

Note

Supported on element textbox.

Warning

Due to limitations of the destination format RTF, there is only very limited support for this property. Or in other words: It might sometimes work...

(view CSS2 description)

2. Custom Properties

downCast uses several custom properties for areas where there are no appropriate CSS2 properties defined as of now. These will be described in the following sections.

Important

All custom properties start with the prefix -ilx-, which is built according to the suggested practice of the CSS working group. The three vendor characters stand for infinity-loop extension. Since the leading hyphen-minus is not an allowed identifier start character in CSS1 and CSS2 parsers, to be compatible with existing parsers, you need to quote it in actual stylesheets. So, when writing custom properties, you should use the literal form \-ilx-....

2.1. -ilx-list-group

Groups all style entries into the same (nested) list style definition by the specified (arbitrary) integer value; see Section 3.2, “Styling a heading” for more details.

2.2. -ilx-marker-format

A format string for the list marker. It must be enclosed in quotes. It may contain arbitrary characters, and may contain placeholders of the form %[0-8] where the numbering of that level in the nested list is inserted. You may also use the placeholder %c ("current") which gets replaced by the level of the list in the tree that specifies this property.

To format a number like "1.1-(a)", the fomat string would be %0.%1-(%2), assuming the levels are outmost, next inner and next inner level.

You cannot specify the numbering style for each level. It is automatically taken from the definition of the list on that specific level you want to use the numbering from.

Note

Supported on elements list and heading.

For more information, see also Section 3.7, “Lists”.

2.3. -ilx-marker-offset

Specifies the offset of the marker position relative to the left margin of the list item.

Note

Supported on elements list and heading.

2.4. -ilx-marker-align

Specifies the alignment of the marker relative to its -ilx-marker-offset position.

Supported values: left, center, right

Note

Supported on elements list and heading.

For more information, see also Section 3.7, “Lists”.

2.5. -ilx-marker-follow

Character that follows the formatted marker string.

Supported values: tab, space, nothing

Note

Supported on elements list and heading.

For more information, see also Section 3.7, “Lists”.

2.6. -ilx-header-offset, -ilx-footer-offset

Vertical offset for the page header and page footer, respectively.

Note

Supported on element document.

2.7. -ilx-paragraph-outline-level

Specifies the logical level a paragraph is in in a RTF document. If not specified, the paragraph is considered body text.

Note

Supported on element heading.

2.8. -ilx-reference-presentation-type

Specifies how a reference to a target should be presented to the user.

Supported values: relpagenumber, pagenumber, number, contextnumber, relnumber, relcontextnumber, numbernotext, contextnumbernotext, relnumbernotext, relcontextnumbernotext

Since this value is translated into Word proprietary field options, you should experiment with the values to find the display format suitable for your specific situation. Applications may interpret the options generated differently.

Note

Supported on element reference.

2.9. -ilx-default-font-family

Set the name of the RTF default font to be used when no specific font selection is available.

Note

Supported on element document.

2.10. -ilx-footnote-style-type

Specifies footnote numbering style for the document.

Supported values: decimal, lower-roman, upper-roman, lower-alpha, upper-alpha, cjk-ideographic, chicago

Note

Supported on element document.

2.11. -ilx-footnote-numbering-policy

Determines footnote numbering policy.

Supported values: continuous, restartsection

When this is restartsection, footnote numbering will restart at 1 for each section.

Note

Supported on element document.

2.12. -ilx-footnote-position

Determines where footnotes will be collected and displayed.

Supported values: textbottom, sectionbottom, pagebottom, documentbottom

Note

Supported on element document.

2.13. -ilx-tab-stops

Determines tabulator positions, kinds and leaders.

For a detailed description of this proeprty, see Section 3.8, “Tabulators”.

2.14. -ilx-image-source

Determines if in the RTF output, the image should be referenced using an INCLUDEPICTURE field or it should be embedded directly in the document.

Supported values: embed, reference

Note

Supported on element image.