Skip to main content
Version: 7.0

Styles of platform views

An application's CSS styles the HTML elements that the web client draws for forms, navigator elements, and windows. Selectors can use classes supplied by the application or attributes set by the web client.

CSS classes​

A class string can contain several CSS class names separated by spaces.

Use name=value tokens with class, captionClass, valueClass, footerClass, and the CLASS options in the table. The client sets an inline style if name is a property of the element's style object and sets an HTML attribute otherwise.

OptionHTML element
classThe element of a form component placed in a container. For a property or action in a panel, it is the component around the value and caption. For a property in a table, it is the render element, either the cell itself or an element inside it. class has no effect on the form's main (root) container. Select it with lsfusion-form.
captionClassThe container's caption element, the caption of a property or action in a panel, or the column header of a property in a table.
valueClassThe container's content element or the value element of a property or action.
footerClassThe footer cell of the property's column.
commentClassThe comment element of the property or action in a panel.
CLASS in NAVIGATORThe navigator element's button in the standard view.
CLASS in WINDOWThe window's view element.
CLASS in PROPERTIESThe same value element as valueClass for a property or action.

Property value classes​

A non-NULL value for valueClass or CLASS in PROPERTIES replaces the platform's default value classes, such as form-control. The classes go on the input element if the value is rendered with one. For a typical text cell in a table, they go on the cell itself (td). A button group or dropdown for a property with a small number of options is drawn inside the value element and keeps its own classes.

Property value elements​

The table lists the default HTML tags for property and action values. The tag design option overrides this choice.

HTML tagWhen the platform chooses it
aA value of the LINK class or a link to a file of a specific type, or a property whose change action opens a form, changes no data and has no input.
inputA value entered as text (a string, number, date or time) in a panel under the value cell rendering rules, or a logical value.
buttonAn action that takes no input value and has an effect.
selectA value chosen from a dropdown rendered as a native selection element under the value cell rendering rules.

In the other cases, including a value drawn by a render function (custom), the value has no explicit tag. In a panel the client renders it in a div. See property value classes for the value element in a table.

A NULL value of a string class displayed in an a element has the default placeholder Not defined. An explicit placeholder takes precedence. With the standard Bootstrap styles, a placeholder in an a uses the link color at half opacity and a placeholder in a div uses the secondary text color.

Selector attributes​

The web client sets these attributes on the elements it draws. A CSS attribute selector can address a form or a component directly.

AttributeElementValue
lsfusion-formRoot element of the formCanonical name of the form, when it has one.
lsfusion-containerForm component's elementComponent identifier, such as PROPERTY(name(i)) or the name of a container.

WebMCP addresses use additional attributes, including lsfusion-form-label, lsfusion-form-window, lsfusion-property, lsfusion-group, and lsfusion-row. React's <Platform> and usePlatform have their own attributes for custom placement.

Color theme​

While the dark color theme is on, the page's root element (<html>) has the attribute data-bs-theme with the value dark. The selector [data-bs-theme="dark"] .board then matches elements of class board. With the light theme the attribute is absent or has the value light. The attribute changes as the theme is switched, without a reload of the page.

Component layout​

For form containers laid out with CSS flexbox, the table shows how the form layout and the design options correspond to CSS properties.

Form designCSS property
Extension coefficient (flex)flex-grow
Base size along the container's main directionflex-basis. The web client uses auto and sets the size through width or height along that direction.
Shrink below the base size along the container's main direction (shrink)flex-shrink (1 for TRUE, 0 for FALSE)
Horizontal overflow of a component (overflowHorz) or its value cell (valueOverflowHorz)overflow-x
Vertical overflow of a component (overflowVert) or its value cell (valueOverflowVert)overflow-y

For containers laid out with CSS Grid, the web client sets track sizes in grid-template-columns and grid-template-rows. For tracks corresponding to the container's lines, lineSize specifies the base size and lineShrink controls shrinking. A track with no specified base size uses min-content. A positive extension coefficient sets the maximum in fr, as in minmax(min-content, 1fr). With shrinking enabled, the minimum is 0px, and without it the minimum is the base track size. For a track with no positive extension coefficient the client uses minmax() with 0px and the base track size if shrinking is enabled, or the base track size alone otherwise.

info

The web client sizes table columns using table-layout: fixed. For each column, the client sets its base width on a sizing cell. For a stretchable column, a second sizing cell gets a percentage based on the column's share of the total extension coefficient. Header and value cells of a stretchable column span both sizing cells.

System window and navigator classes​

SystemEvents supplies these class strings for system windows and navigator entries. It appends the helper classes to the base classes when the corresponding conditions hold.

Window or navigator entryBase classesHelper classes and their conditions
logobg-dark-subtleThe desktop web client uses these classes when no React component draws the window. A vertical navbar gets navbar-force-align-start and also navbar-text-on-hover when navigatorPinMode[] is NULL and no React component lays out the windows. A horizontal navbar gets navbar-auto-icon-font-size.
rootbg-dark-subtle navbar-icon-largeThe desktop web client uses these classes when no React component draws the window. A vertical navbar gets navbar-force-align-start. Either orientation gets navbar-text-on-hover when navigatorPinMode[] is NULL and no React component lays out the windows.
systembg-dark-subtleOn the desktop web client, navbar-icon-large always applies and a horizontal navbar gets navbar-text-hidden. For a vertical navbar whose window has no React component, that client adds navbar-force-align-start and also navbar-text-on-hover when navigatorPinMode[] is NULL and no React component lays out the windows.
formsbg-body-tertiarydont-show-close-button on the mobile web client, or when dontShowCloseButtonOnInactiveTab[] holds and no React component draws the window
toolbarbg-body-secondarynavbar-popup-over-selected-hover on the desktop web client unless the navigator is pinned entirely (navigatorPinMode[] is TTRUE) or a React component lays the windows out
logbg-body-secondarynavbar-popup-over-selected-hover navbar-always-hide-unpinned on the desktop web client while the log window is not pinned (logsPinMode[]) and no React component lays the windows out
logoActionnavbar-icon-largenavbar-hidden on the mobile web client without Bootstrap (useBootstrap[] does not hold)
toggleNavigatorPinMode—navbar-hidden on the mobile web client
CSS classEffect in the standard view
bg-dark-subtle, bg-body-tertiary, bg-body-secondarySet the window background using the Bootstrap theme.
navbar-icon-largeEnlarges navigator icons.
navbar-text-on-hoverReveals navigator captions on hover while a form is open.
navbar-force-align-startAligns navigator buttons at the start of the cross axis.
navbar-auto-icon-font-sizeSizes font icons to the height of the horizontal navbar in Chromium and Safari.
navbar-text-hiddenHides navigator captions.
dont-show-close-buttonHides the close button on inactive form tabs.
navbar-popup-over-selected-hoverOpens the window's navigator items as an overlay on hover or after selection when a form is open.
navbar-always-hide-unpinnedKeeps the unpinned log window collapsed when idle, including when no form is open.
navbar-hiddenHides the navigator button.

Stylesheet loading​

Use a CSS import in a client JavaScript module for a stylesheet included in the build. A standalone .css file in resources/web/init loads automatically when a page opens. You can also register a stylesheet for web-client initialization with onWebClientInit[STRING] or load it explicitly with INTERNAL CLIENT.