Skip to content

Styling a node ​

A node's style is set in two places, and both work the same way:

  • The Inspector's Style section: the style properties the node sets, each with its field.
  • The Style tab: the same for the node or one of its parts (::header-cell), next to its classes, the format painter and "Save as class". With one node selected, it also shows what each property computes to.

Styles for every element of a type, such as every table's header cells, are the report's defaults (below).

In both, the properties sit under group headings, and one search field adds a property. Margin and padding are edited as one box. The Rules editor in the Style tab uses the same search field.

A library's classes are edited the same way, with no node to start from, in the library's Classes tab (libraries.md).

Finding a property ​

The search field, "Add a property…", is at the top of the style properties. In the Style tab, screen readers call it "Add a style property", or "Add a style property for ::header-cell" when a part is picked. Type to filter.

  • What matches: a label that starts with what you typed comes first, then a later word of a label ("top" finds Margin top), then the text anywhere in a label, then in the CSS name (z-index), then in a property's search words. Only when nothing matches that way do letters in order count (bgc finds Background color). Matched letters are highlighted.
  • Search words are the words people use for a property rather than its CSS name: bold finds Font weight, rounded Border radius, keep together Break inside, leading Line height, fill Background color, transparency Opacity. A match by a search word says which: Font weight “bold”.
  • Each row shows the property's label, and its CSS name on the right. A property the node already sets has a check and "set".
  • Groups come in the order of their best match. Among equally good matches, a property you added recently comes first.
  • With nothing typed, the list shows Recent first, then every group in order.

The list opens under the field, or above it when there's more room there.

KeyDoes
↑ ↓Move through the list
EnterAdd the highlighted property, or go to it if it's set
EscapeClose the list, keeping what you typed; with the list closed, nothing (commands.md)
BackspaceAt the start of the field, search every group again after a group's + Add
/Put the cursor in the search field, while the Inspector or the Style tab has focus and the cursor isn't in a text field

Picking a property that isn't set adds it and puts the cursor in its value: in the Inspector its field, in the Style tab an empty row. Picking one that is set puts the cursor in its field.

Setting it in one go: type name: value, such as padding: 8pt or font-weight: 600. The list offers "Set Padding → 8pt", and Enter adds the property with that value as one edit. In the Inspector the value is checked as the property's field checks it, and a value the field wouldn't take shows its error and adds nothing. In the Style tab the value is sent as typed, and a refused one shows the edit's error, as the tab's other edits do.

Recent is the last five properties you added, in either place, newest first. It's kept in this browser only, so it isn't shared with other browsers or people.

The groups ​

Properties are listed and searched in eleven groups, in this order:

GroupWhat's in it
TextColour, font family, size, weight and style, numeric figures, line height, letter and word spacing, alignment, decoration, transform, indent, vertical alignment, white space, hyphens, direction, overflow wrap
SpacingMargin and padding, all sides and each side
SizeWidth and height, their minimum and maximum, box sizing
BorderBorders, all sides and each side, with their width, style and colour; border radius, all corners and each corner; outline
BackgroundColour, image, size, position, repeat
LayoutDisplay, flex and grid, alignment, gaps
Multi-columnColumns, their count, width, gap and rule, how they fill and span
PaginationBreaks before, after and inside, orphans, widows, the page template, how a box is drawn at a page break
PositionTop, right, bottom, left, stacking order, rotation
Visibility and overflowOverflow, text overflow, visibility, opacity
TableBorder collapse, table layout
  • Position is offered only for a node inside a frame, the only place those properties apply (RFML §8.4). Table is offered only on a table. Every other group is offered for every node.
  • Most labels are made from the CSS name ("Margin top"). Six have their own: Numeric figures (font-variant-numeric), Grid columns and Grid rows (grid-template-columns, grid-template-rows), Stacking order (z-index), Page template (page) and Box at a page break (box-decoration-break).
  • The groups, labels and search words come from the RFML schema: each property in css.props has x-rfml-group, title where it has its own label, and x-rfml-keywords, and css.props lists the groups in order in x-rfml-groups. They are hints for tools, not part of the language (RFML §8.4).

The properties a node sets ​

The properties the node sets are listed under their group headings, in the groups' order, each with its field and a remove button. Removing one is one undo step.

  • + Add on a heading opens the search field for that group only, shown as a chip in the field. Press Backspace at the start of the field, or the chip's ×, to search every group again.
  • In the Inspector each property keeps the field it had: a list for a choice of keywords, a length or colour field, or text.
  • In the Style tab each row has the property's label, as in the search list. Where the CSS name says more than the label (font-variant-numeric under "Numeric figures"), it is shown in small type under it; hovering any label shows it.
  • Several nodes selected: a property set on any of them is listed. Its field says "Mixed" where they differ, and an edit changes all of them in one undo step. Nodes that lock their style are left out, with a notice (multi-edit.md).

Where a value comes from ​

With one node selected, the Style tab shows each property's computed value under its field, with where it comes from. A tag says which kind of source wins:

  • Set here: the node's own style. When it replaces a value a linked library gives (its theme's defaults or one of its classes), the row says so ("Replaces brand's var(--house)"), and the field's × is Reset property to brand's value: removing the node's own value brings the library's back. Without a library value under it, the × is Clear property.
  • library (brand): the theme a linked library gives the report, from its defaults for the element type or one of its classes. The report's own tokens, defaults, classes and each node's style override it, property by property.
  • class, report defaults or rule: the report's own classes, styles.defaults, or a matching rule.
  • inherited · library: inherited from a parent box whose value the library gives. A value inherited from the report's own styles, or the engine's default, has no tag.

The source after the value names the block (brand's theme, defaults.heading, class money, inherited from document). Click the property's name for every source, first to last, with the ones a later source beats struck through.

The Inspector's Style section lists only what the node sets. When a linked library gives the node more, a line under it says how many ("3 values from brand's theme") with Open in Style.

Token and class suggestions (var(--…) in a field, Add a class) include the linked theme's tokens and classes after the report's own.

Defaults for every element of a type ​

The report's defaults (styles.defaults, RFML §8.1–8.2) style every element of a type, and their parts: every table's header cells with background-color: #efefef, every heading in the brand colour. document holds the report's own text, which the body inherits, such as its default font.

How overriding works ​

The defaults sit low in the cascade. Each source applies all of its blocks, the element's own and then its parts from general to specific, before the next source applies any:

  1. The engine's defaults.
  2. A linked library's theme: its defaults, then its classes.
  3. The report's defaults.
  4. The node's classes, in order.
  5. The node's own style.
  6. The node's rules.

So a class, a node's own style or a rule beats a default, property by property. A table that sets its own background-color on ::header-cell keeps it. So does a table whose own ::cell part sets one: cell is the more general part, but the node's style is a later source than the defaults. The report's defaults for a type beat the library theme's for the properties they set, and the theme's others still apply.

In the Style tab a value from the defaults is tagged report defaults, and its source reads defaults.table ::header-cell. A library's reads brand's theme, defaults.table ::header-cell.

Making a node's style the default ​

With one node selected, the Style tab's Make it the default for every table section takes the node's own values for what the Part field shows: the node itself, or a part such as ::header-cell.

  • The list: each value with a checkbox. All are ticked, except the box's size and place (width, height, their minimum and maximum, position, top … left, z-index). A value the defaults already set says what it replaces.
  • Make default copies the ticked values into the type's defaults (defaults.table.parts.header-cell), property by property, so the defaults' other properties stay. It clears them from the node, so later changes to the default reach this table too. It is one undo step.
  • The node looks the same. A value whose clearing would change the node stays on it, and the list says why: "Stays on t1 too: class zebra sets background-color: #ffffff". That happens when a class on the node, or the node's own block of a more general part, would then beat the new default.
  • Keep them on t1 too copies the values without clearing any.
  • The other tables take the values at once, unless they set them themselves. The section says how many others the report has, in the body, page templates and components.

The Defaults section in the Theme tab ​

The Theme tab's Defaults lists each element type with defaults ("Table", "Report text" for document), and the parts each styles.

  • A row opens that type's editor in the panel, with ← Theme to go back. The editor is the class editor (libraries.md): the type itself or one of its parts, the property search, the spacing box, colours from the tokens, the font picker, and the engine's problems at each field. The parts offered are the type's own (RFML §8.6), and the property groups are those the type takes. The canvas beside it shows each change.
  • + Add defaults for… picks an element type and opens its editor. Nothing is written until a property is set.
  • × removes the type's defaults, parts and all, as one undo step.
  • With a linked library's theme, the library's types are listed too, tagged with the library's name, Overridden when the report sets some of the same type, or This report. In the editor, a property the library sets shows under its field ("From brand: var(--house)"), with the library's value as the placeholder. Typing a value overrides that property only ("Replaces brand's var(--house)"), and its × resets it to the library's. On an overridden type, the row's × resets the whole type to the library's.

A library's theme has its defaults on the library's Defaults tab instead, with starter defaults and copies to and from a class (libraries.md): every report that takes the theme gets them. A release names each default added, changed or removed (libraries.md).

Margin and padding: the spacing box ​

Margin and padding are one box in the Spacing group, in place of their ten separate rows: the margin outside, dashed, the padding inside, tinted, and a small field on each side. Under the box, the CSS it holds is shown as text (padding: 8pt 10pt, margin-bottom: 12pt).

  • When it shows: when the node sets any margin or padding, as a shorthand or a side, or as soon as one is picked in the search field. Picking one side puts the cursor in that side's field.
  • A field applies its value on Enter or when you leave it. An empty field removes that side. Escape leaves the field as typed; Ctrl+Z in it, before you leave it, puts back what it showed (commands.md). Values are lengths or tokens (var(--space-2)), offered as you type, and checked as the length fields check them.
  • What it writes:
    • A side writes its own property, such as padding-top.
    • Where the shorthand is set (padding: 8pt 10pt), editing one side writes the four sides and removes the shorthand, so the other sides keep their values. That is one undo step.
    • Same on all sides, in the Spacing heading, makes an edit write the shorthand (padding: 8pt) and remove the sides.
    • Remove margin and padding, also in the heading, removes them all.
  • The middle of the box shows the content's size:
    • In the Inspector, the width and height the node's style sets ("auto" where it sets none).
    • In the Style tab, with one node selected, the size the engine computes. Empty sides there also show their computed value (0pt) as a hint.
    • Nothing is shown for several nodes, or with box-sizing: border-box, where the box's size includes the padding.
  • Several nodes selected: a side says "Mixed" where they differ, and an edit changes all of them in one undo step. The box compares what each side comes to, so padding: 4pt on one node and padding-top: 4pt on another agree on the top.
  • In the Style tab the box edits the picked part too (::header-cell), writing to that part's style.

Styling words in a text: spans ​

A span styles some of the words in a text or heading: an account number in bold, a status in a coloured pill. It sits inside the text, so it has no id and no box of its own on the page. Its text is edited on the canvas with the rest.

  • Making one:
    • While you edit a text on the canvas, select some words and click span in the editor's toolbar, or press Ctrl+Alt+S. With nothing selected, it adds the words span element at the cursor, selected, so what you type replaces them.
    • Span in the Insert panel's Text group does the same while a text is being edited. With a text or heading selected, it adds span element at its end and opens the editor there. Anywhere else, it adds a new text holding one span after the selection.
    • Each of these is one undo step. Typing over the placeholder is another.
  • Styling it: while the cursor is in a span, the Inspector shows a Span section above the text's own fields: its classes, its style, If (show the words only when an expression is true), its language and its conditional rules. The section stays after the editor closes, until you select something else. A span takes the text properties, a background, padding, a border and rounded corners. Margins, sizes and position have no effect on it.
  • Removing it: Remove span in that section takes the span away and keeps its words in their place.