Table of Contents

Style rules

Note

Style rules have been available since version 2.1.

Style rules are used to conditionally style the datagrid.

Later, it will be possible to evaluate style rules using UI code to apply style manually to template elements (on tiles in a repeat, for example).

How to define a style rule

In Neos Studio, style rules are defined at the UI view level.

A style rule has :

  • A unique name.
  • An execution order to control the rule’s priority in relation to other rules.
  • A mandatory application condition that returns a boolean to determine if the rule is applied.
  • The target property where the style is applied. If not specified, all properties are affected.
  • An Enabled boolean that can deactivate a rule, useful for debugging.

The style elements that can be customized include:

  • Background color (light theme)
  • Text color (light theme)
  • Background color (dark theme)
  • Text color (dark theme)
  • Icon displayed before cell content
  • Content display mode (icon before text or icon only)
  • Horizontal alignment (start, center, end)
  • Bold text
  • Italic text
  • Underlined text
  • Strikethrough text

Specifications

Different colors can be set based on the current theme’s color scheme, as certain colors may not suit both light and dark themes. If only a background color for the light theme is specified, it will still apply when the theme is dark, and vice versa.

If two rules apply to the same cell, their styles will merge. For instance, if the first rule makes the text bold and the second rule sets the background color to red, the cell will display with a red background and bold text.