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. text-underline-color
1.17. text-line-through-style
1.18. font-variant
1.19. font-weight
1.20. text-transform
1.21. line-height
1.22. vertical-align
1.23. font-style
1.24. background-color
1.25. widows, orphans
1.26. page-break-inside, page-break-after
1.27. page-break-before
1.28. page
1.29. word-break-inside
1.30. border-spacing
1.31. letter-spacing
1.32. float
1.33. position
1.34. top, left, right, bottom
1.35. z-index
1.36. clear
1.37. -ilx-column-count
1.38. -ilx-column-width
1.39. -ilx-column-gap
1.40. -ilx-column-rule
1.41. display
1.42. table-layout
2. Custom Properties
2.1. -ilx-list-group, -ilx-list-level
2.2. -ilx-marker-format
2.3. -ilx-marker-offset
2.4. -ilx-marker-align
2.5. -ilx-marker-follow
2.6. -ilx-marker-font-family
2.7. -ilx-marker-font-size
2.8. -ilx-header-offset, -ilx-footer-offset
2.9. -ilx-paragraph-outline-level
2.10. -ilx-reference-presentation-type
2.11. -ilx-default-font-family
2.12. -ilx-footnote-style-type, -ilx-endnote-style-type
2.13. -ilx-footnote-numbering-policy, -ilx-endnote-numbering-policy
2.14. -ilx-footnote-position, -ilx-endnote-position
2.15. -ilx-tab-stops
2.16. -ilx-image-source
2.17. -ilx-wrap-distance-horizontal, -ilx-wrap-distance-vertical
2.18. -ilx-list-numbering-absolute
2.19. -ilx-gutter
2.20. -ilx-facing-pages
2.21. -ilx-mirror-margins
2.22. -ilx-editing-rights
2.23. -ilx-footnote-marker
2.24. -ilx-following-style
2.25. -ilx-style-update
2.26. -ilx-page-numbering-start
2.27. -ilx-page-numbering-mode
2.28. -ilx-page-numbering-style
2.29. -ilx-text-visibility

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, row

(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, ilx-outline, ilx-shadow, ilx-emboss, ilx-engrave

(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. text-underline-color

Text underline color.

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.17. text-line-through-style

Text line through style.

Supported values: none, solid, double

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.18. font-variant

Variation of the font.

Supported values: normal, small-caps

(view CSS2 description)

1.19. 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.20. text-transform

Turns text into capitals.

Value: uppercase

(view CSS2 description)

1.21. line-height

Specifies the minimal line height.

When specifying the height in a relative unit (i.e., em, % or ex), the resulting value is interpreted as a minimum line height, with the rendering engine being free to increase that value based on the specific line contents. If you specify an absolute value, it is interpreted as being a definite value, with larger content in that line possibly being clipped.

(view CSS2 description)

1.22. 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.23. 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.24. background-color

Sets the background color.

Note

Supported on elements par, inline and cell.

(view CSS2 description)

1.25. 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.26. 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.27. page-break-before

Controls page break algorithm.

Supported values: auto, always, left, right

Note

Supported on element part.

(view CSS2 description)

1.28. page

Selects a named @page rule to be applied, see Section 2, “Specifying page sizes”.

Note

Supported on element part only.

(view CSS2 description)

1.29. 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.30. border-spacing

Specifies the spacing between borders of table cells.

Note

Supported on element table.

(view CSS2 description)

1.31. letter-spacing

This property specifies spacing behavior between text characters.

(view CSS2 description)

1.32. 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.33. 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.34. 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.35. z-index

Specifies the layer of the element.

Note

Supported on positioned elements textbox and image.

(view CSS2 description)

1.36. 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)

1.37. -ilx-column-count

Specifies the number of columns in this section.

Note

Supported on element part.

Note

This is a CSS3 Draft property, and therefore prefixed by our vendor-prefix -ilx- . Once the CSS3 draft reaches Recommendation state, you will be able to use the property without prefix.

(view CSS3 description)

1.38. -ilx-column-width

Specifies the width of columns in this section.

Note

Supported on element part.

Note

This is a CSS3 Draft property, and therefore prefixed by our vendor-prefix -ilx- . Once the CSS3 draft reaches Recommendation state, you will be able to use the property without prefix.

(view CSS3 description)

1.39. -ilx-column-gap

Specifies the padding between columns.

Note

Supported on element part.

Note

This is a CSS3 Draft property, and therefore prefixed by our vendor-prefix -ilx- . Once the CSS3 draft reaches Recommendation state, you will be able to use the property without prefix.

(view CSS3 description)

1.40. -ilx-column-rule

Specifies whether there should be a rule between columns.

The output format RTF does not support specifying a specific rule style. This means that a rule will be present if this property value does not contain the value none .

Note

Supported on element part.

Note

This is a CSS3 Draft property, and therefore prefixed by our vendor-prefix -ilx- . Once the CSS3 draft reaches Recommendation state, you will be able to use the property without prefix.

(view CSS3 description)

1.41. display

Specifies the display type. Only inline and block are currently respected, and the semantics of elements defined in the upCast DTD always override any setting of this property. downCast supports two additional values, ilx-internal-block and ilx-internal-inline. These can be used as replacements for block and inline, respectively, to indicate that the specific style should not be used to create a named paragraph or character style in the destination RTF file.

(view CSS21 description)

1.42. table-layout

Specified if table elements (cells) should grow horizontally with their contents (auto) or not (fixed).

(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, -ilx-list-level

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. Use -ilx-list-level to indicate which level (1-based) within the specified list group this is a definition for.

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 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 7, “Lists”.

2.5. -ilx-marker-follow

Character that follows the formatted marker string.

Supported values: tab, space, none

Note

Supported on elements list and heading.

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

2.6. -ilx-marker-font-family

font-family to use for the marker string.

This property sets RTF font properties based on a predefined internal config file, stdfonts.config.

(view CSS2 description)

Note

Supported on elements list and heading.

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

2.7. -ilx-marker-font-size

font-size to use for the marker string.

(view CSS2 description)

Note

Supported on elements list and heading.

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

2.8. -ilx-header-offset, -ilx-footer-offset

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

Note

Supported on element document.

2.9. -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.10. -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.11. -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.12. -ilx-footnote-style-type, -ilx-endnote-style-type

Specifies footnote/endnote 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.13. -ilx-footnote-numbering-policy, -ilx-endnote-numbering-policy

Determines footnote/endnote numbering policy.

Supported values: continuous, restartsection

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

Note

Supported on element document.

2.14. -ilx-footnote-position, -ilx-endnote-position

Determines where footnotes/endnotes will be collected and displayed.

Note

Supported on element document with values: textbottom, sectionbottom, pagebottom, documentbottom.

Supported on element part with values: textbottom, pagebottom.

2.15. -ilx-tab-stops

Determines tabulator positions, kinds and leaders.

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

2.16. -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.

2.17. -ilx-wrap-distance-horizontal, -ilx-wrap-distance-vertical

The distance in which content should wrap around a positioned paragraph.

Note

Supported on positioned element par.

2.18. -ilx-list-numbering-absolute

Sets the initial index as integer of the first item of a list. The value is 1-based, with 1 being the default.

This will be replaced by conformant handling of this situation using CSS counters.

Note

Supported on element list.

2.19. -ilx-gutter

Sets a gutter value length in @page rules, see Section 2, “Specifying page sizes”.

Note

Supported in @page rules only.

2.20. -ilx-facing-pages

Determines whether the layout should be two-sided with facing pages (value: true) or single-sided (value: false), see Section 2, “Specifying page sizes”.

Tip

Do not use this property, but specify separate @page:left and @page:right rules instead.

Note

Supported on document element only.

2.21. -ilx-mirror-margins

Determines whether the page layout should be mirrored between even and odd pages (value: true) or not (value: false), see Section 2, “Specifying page sizes”.

Tip

Do not use this property, but specify separate @page:left and @page:right rules instead.

Note

Supported on document element only.

2.22. -ilx-editing-rights

Lets you specify at part granularity whether the user should be able to edit the contents (value: full) or not (value: none).

Supported values: full, none

Note

Supported on part element only.

2.23. -ilx-footnote-marker

Determines whether footnote markers should be auto-generated.

This may prove useful when you have the pre-processing system generate specially formatted footnote reference characters and do not want the RTF rendering application to insert automatically generated ones. In this case, set this property to suppress.

Supported values: suppress, auto

Note

Supported on document element only.

2.24. -ilx-following-style

Determines the following style to be used in the rendering application when hitting Return. The style is identified by its class name. The functionality is equivalent to setting a specified paragraph style as the "next" one in Word's style managing GUI.

Supported values: class name of style with display: block .

Note

Supported only in the external CSS stylesheet and only within the declaration block for a class selector with display: block (so that it is made a Paragraph Style in the RTF).

2.25. -ilx-style-update

Determines whether style definitions should be overridden by their definitions in the document's template at loading time. This switch corresponds to Word's "Automatically update styles from template". When none, styles are not automatically updated, but their definitions in the opened document take precedence. When link, styles are updated to their current definitions in the referenced document template.

Supported values: none, link

Note

Supported only in the external CSS stylesheet and only within the declaration block for a class selector with display: block (so that it is made a Paragraph Style in the RTF).

2.26. -ilx-page-numbering-start

Sets the start number for page numbering. The default is 1.

Supported values: <integer>

Note

Supported only on the document and part elements.

2.27. -ilx-page-numbering-mode

Sets how page numbering is handled for this part, either continued from previous part or restarted.

Supported values: continue, restart

Note

Supported only on the part element.

2.28. -ilx-page-numbering-style

Sets the page number rendering style.

Supported values: decimal, upper-roman, lower-roman, upper-latin, upper-alpha, lower-latin, lower-alpha

Note

Supported only on the part element.

2.29. -ilx-text-visibility

Sets the hidden property on text in RTF.

Note

You should use this property only for defining named styles. In content, use the hidden element.

Supported values: full, none