Repository navigation
RCSS Text
- text-align
| Value: | left | right | center | justify |
| Initial: | left |
| Applies to: | block-level elements |
| Inherited: | yes |
| Percentages: | N/A |
This property affects how inline boxes within a line box are aligned. Values have the following meanings:
- left
- The row of inline boxes are aligned against the left edge of the line box.
- right
- The row of inline boxes are aligned against the right edge of the line box.
- center
- The row of inline boxes are aligned in the centre of the line box.
Known issue:
justifyis accepted but not implemented; justified text renders left-aligned.
- text-decoration
| Value: | none | underline |
| Initial: | none |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
Values have the following meaning:
- none
- Any text generated by this element has no additional decoration.
- underline
- Any text generated by this element has an underline, with a thickness and position specified by the font.
The colour of any decoration is the same as the font colour. Note that overline and line-through is not yet supported in RCSS. For a dashed, dotted or differently coloured line under a whole element, use FSO's underline decorator (see RCSS Decorators).
Instead of using the CSS-standard text-shadow property, text-shadowing is implemented in libRocket using the more generic font effect system (see RCSS FontEffects). Below is an example of how to specify a shadow for an element of text.
/* Specify a grey text shadow on primary headings. */
h1
{
darken-font-effect: shadow;
darken-offset: 2px 2px;
darken-color: grey;
}- text-transform
| Value: | none | capitalize | uppercase | lowercase |
| Initial: | none |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
This property changes the case of the text as it is displayed; the text in the document is not changed. Values have the following meanings:
- none
- The text is displayed as written.
- uppercase
- All letters are displayed in uppercase.
- lowercase
- All letters are displayed in lowercase.
- capitalize
- Intended to capitalise the first letter of each word.
Only the unaccented letters A to Z are converted; accented and other non-ASCII letters are left as written.
Known issue:
capitalizeis accepted but does nothing; the text is displayed as written. Capitalise the text in the RML or in Lua instead.
- white-space
| Value: | normal | pre | nowrap | pre-wrap | pre-line |
| Initial: | normal |
| Applies to: | block-level elements |
| Inherited: | yes |
| Percentages: | N/A |
This property defines how whitespace (any spaces, end-lines, carriage-returns and tabs) are processed in sections of text. Values have the following meanings:
- normal
- Sequences of whitespace are collapsed down to single spaces. Lines are broken as necessary to fit line boxes. Line breaks in the source are ignored.
- pre
- Sequences of whitespace are preserved. Lines are only broken where line breaks are present in the source.
- nowrap
- Sequences of whitespace are collapsed. Lines are not broken.
- pre-wrap
- Sequences of whitespace are not collapsed. Lines are broken to fit line boxes or where line breaks are present in the source.
- pre-line
- Sequences of whitespace are collapsed. Lines are broken to fit line boxes or where line breaks are present in the source.