Skip to main content

styles Property

Syntax

Style keys use CSS selector syntax with a leading dot. The value contains one or more CSS property declarations wrapped in curly braces.
Style values MUST be wrapped in {} braces. Without the curly braces, styles may fail to apply. Correct format: '.rpn1': '{background-color: #eaf5e9 !important; color: #1d5f20 !important;}'.
CSS styles in Risksheet typically require !important to override the grid’s default cell styling. Without !important, custom background-color and color declarations are overridden by the grid’s base styles. This is the most common issue when conditional formatting colors do not appear. Always include !important on background-color, color, and other visual properties you need to take effect.

How Styles Are Applied

Styles flow from configuration to visual display through three pathways:
diagram
Path 1: Cell Decorators — JavaScript functions in cellDecorators evaluate cell values at render time and use $(info.cell).toggleClass('className', condition) to dynamically add or remove CSS classes. Path 2: Column cellCss — A static CSS class applied unconditionally to every cell in the column. Path 3: Header Group headerGroupCss — A static CSS class applied to the header group row for columns within that group.

Built-In Style Patterns

RPN Risk Level Colors

Standard Risk Priority Number (RPN) risk level color coding used with the rpn and rowHeaderRpnNew cell decorators. These are the most commonly used styles in FMEA configurations. RPN thresholds are user-configurable per deployment — the values below are common examples but vary by project.

RPN Color Reference Table

Header Group Styling

Style the first and last rows of column header groups using compound CSS selectors. The .firstRow and .lastRow pseudo-classes target the top and bottom rows of multi-level column headers.

Column-Level CSS Properties

cellCss Property

headerGroupCss Property

Row Height Control

Risksheet does not have a built-in row height property. Limit row height for columns with long text content using a combination of cellDecorators, styles, and the cellRenderer column property.
Since Risksheet does not expose a native rowHeight property, the max-height + overflow: hidden CSS technique via cell decorators is the recommended approach. Adjust the max-height value to match your desired maximum row height in pixels.

System CSS Classes

Risksheet automatically applies the following CSS classes to grid elements. These are not defined in the sheet configuration — they are managed by the grid infrastructure.
The system CSS class names listed above are based on source code analysis. Additional system classes may exist in your specific Risksheet version. Inspect the DOM in your browser developer tools to discover all available classes.

Supported CSS Properties

The styles object accepts any valid CSS property. Commonly used properties in Risksheet configurations include:

Complete Example

Full configuration combining RPN styles, header group colors, row height control, and custom severity styling:
Last modified on July 10, 2026