Style a view with custom CSS
Section titled “Style a view with custom CSS”This how-to is for builders who want a view to look different from the platform default. Examples: highlight one field, make a column wider, make a dashboard figure stand out, or tint the records that are waiting at a workflow step. You will learn what each box under Custom style accepts, where OSOS puts your CSS, and which class names you can safely target. You will also learn how to colour records by tag without writing CSS, and how to style a whole page and its widgets.
You need:
- Access to Administration with the right to edit the entity’s views.
- A view to style. See Data Views & Faces.
- Basic CSS knowledge: selectors, declarations, and
@media.
Where custom style lives
Section titled “Where custom style lives”- Open Administration › Applications › Data Entities, then select the entity.
- Select the Views tab, then open the view.
- Select the Web settings tab. Custom style is at the top. The view’s scripts are under it.
Custom style has these parts:
| Part | What you type | Shown when |
|---|---|---|
| View style | CSS, one box per screen of the view | Always |
| Fields style | Class names, per field and per screen | Always |
| Dashboard style | Class names, per dashboard card | The view’s dashboard is on |
| Workflow step style | Class names, per workflow step | The entity has a workflow |
| Button dialog style | Class names, per button that asks the user for input | The view has such a button |
| Mobile theme override (JSON) | JSON for the mobile app | Always |
The mobile part does not use CSS. See Override mobile app colours per view and page.
The key idea: you write CSS only in View style. Every other part takes
class names, separated by spaces (for example must-read wide-col). OSOS
adds those classes to the right element. You then target them from View style.
View style: where your CSS goes
Section titled “View style: where your CSS goes”View style has one box for each screen the view has switched on:
| Box | Applies to | OSOS wraps your CSS in |
|---|---|---|
| General | Every screen of this view: the list, the record’s details and the forms | A class unique to this copy of the view |
| Details | The record’s details screen | .view-entry-details |
| Table view | The table face | .face-table-view |
| Calendar view | The calendar face | .face-calender-view |
| Card view | The card face | .face-badge-view |
| Kanban view | The kanban face | .face-kanban-view |
| Tree view | The tree face | .face-tree-view |
| Counter view | The counter face | .face-miniCard-view |
| Create Entry | The create form | .view-create-entry |
| Edit Entry | The edit form | .view-edit-entry |
| Show Message after saving | The message shown after saving | .view-show-message |
| Ask User For | The dialog a button opens to ask for input | .view-ask-for-user-wrapper |
| Dashboard | The view’s dashboard | .face-dashboard-view |
Only the boxes for screens and faces you have switched on appear. The timeline face has no box of its own. Use General for it.
How your CSS is applied
Section titled “How your CSS is applied”OSOS puts the text of a box inside a rule for that box’s wrapper class. If you type this in Table view:
color: var(--text-color-secondary);
& td { padding-block: 0.25rem;}the browser receives:
.face-table-view { color: var(--text-color-secondary);
& td { padding-block: 0.25rem; }}This is standard CSS nesting. So:
- Plain declarations (
color: …;) style the wrapper itself. - Nested rules (
& td { … },.must-read { … }) style elements inside the wrapper. Start each nested selector with&or a class name. A nested selector that starts with a bare element name (such astd { … }) only works in recent browsers. @mediaworks inside a box, for example@media (max-width: 640px) { & td { padding: 0; } }.- You cannot reach anything outside the wrapper. A rule such as
body { … }becomes “abodyinside the wrapper” and matches nothing.
Fields style: add class names to a field
Section titled “Fields style: add class names to a field”Fields style lists every field of the view. Expand a field to see one box per screen: General, Details, one box per face (Table view, Calendar view, Card view, Kanban view, Tree view, Counter view), Create Entry, Edit Entry, and more. A block field has no face boxes.
Type one or more class names in a box. OSOS adds them to the element that holds the field’s value on that screen:
- A class in General is added on every screen.
- A class in a face or screen box is added on that screen only, together with the General classes.
- When a field has at least one class, OSOS also adds the field’s internal name as a class. Use your own class names in your CSS. They are easier to read and do not change if you rename a field.
Then style the class from View style. For example, give the field Notes the
class must-read in General, and type this in View style › General:
.must-read { border-inline-start: 3px solid var(--primary-color); padding-inline-start: 0.5rem;}In the table face, the class sits on the value inside the cell, not on the cell
itself. To style the whole cell, use :has(): & td:has(.must-read) { … }.
Dashboard style: class names for dashboard cards
Section titled “Dashboard style: class names for dashboard cards”Dashboard style lists the dashboard cards (statistics queries) the view’s
dashboard shows. Expand a card and type class names in its Dashboard box.
OSOS adds them to the card, next to the card’s own dashboard class.
Inside a card you can target:
| Selector | What it is |
|---|---|
.card-dashboard__title | The card’s title |
.card-dashboard__sub-title | The line under the title |
.card-dashboard__body | The card’s content area |
.number-view-content strong | The figure, on a card that shows a single number |
Write the CSS in View style › Dashboard.
Workflow step style: tint records at a step
Section titled “Workflow step style: tint records at a step”Workflow step style lists the steps of the entity’s workflows. Expand a step and type class names in its boxes (General, Details, the faces and Edit Entry). When a record’s current step is that step, OSOS adds the classes:
- in the Table view, to the record’s row;
- in the Kanban view, to the record’s card;
- on the record’s details screen, to the section that holds its fields;
- in the edit form, to the form.
Write the CSS in View style › General, so it works on every screen.
Button dialog style: style an “ask the user” dialog
Section titled “Button dialog style: style an “ask the user” dialog”Some buttons open a dialog that asks the user for input before they run (see
Buttons). Button dialog style lists those buttons.
Type class names in a button’s Ask User For box. OSOS adds them, with the
class askForUser, to the box that holds the dialog’s fields. Write the CSS in
View style › Ask User For.
Right-to-left and dark themes
Section titled “Right-to-left and dark themes”People use the same view in English and Arabic, and in light and dark themes. Write CSS that works in all four.
Direction. OSOS sets dir="ltr" or dir="rtl" on the page from the
user’s language. Use logical properties, which flip by themselves:
| Instead of | Use |
|---|---|
margin-left, margin-right | margin-inline-start, margin-inline-end |
padding-left, padding-right | padding-inline-start, padding-inline-end |
border-left | border-inline-start |
text-align: left | text-align: start |
left: 0 | inset-inline-start: 0 |
When nothing else works, target the direction: [dir="rtl"] & { … }.
Colours. Do not hard-code colours like #ffffff or black. Use the theme’s
CSS variables. They change with the theme and with dark mode:
| Variable | Use it for |
|---|---|
--primary-color | The theme’s main colour: accents, highlights |
--primary-color-text | Text on a --primary-color background |
--text-color | Normal text |
--text-color-secondary | Muted text |
--surface-a | Card and panel backgrounds |
--surface-b | Page background |
--surface-c | A light hover or stripe tint |
--surface-d | Thin borders and dividers |
--color-invalid | Errors and warnings |
To make a light tint of a theme colour that works on both light and dark
backgrounds, mix it with transparent:
background: color-mix(in srgb, var(--primary-color) 12%, transparent);
For the full list of variables and how to set them for your brand, see Brand the platform.
Cookbook
Section titled “Cookbook”Each recipe says where each piece goes.
Highlight a field everywhere
Section titled “Highlight a field everywhere”- Fields style › your field › General:
must-read - View style › General:
.must-read { background: color-mix(in srgb, var(--primary-color) 10%, transparent); border-inline-start: 3px solid var(--primary-color); padding-inline-start: 0.5rem;}Make a table column wider
Section titled “Make a table column wider”- Fields style › your field › Table view:
wide-col - View style › Table view:
.wide-col { min-inline-size: 20rem;}The table sizes each column to its widest content, so the whole column grows.
Make table rows more compact
Section titled “Make table rows more compact”- View style › Table view:
& td { padding-block: 0.25rem;}Make a dashboard figure stand out
Section titled “Make a dashboard figure stand out”- Dashboard style › your card › Dashboard:
kpi-big - View style › Dashboard:
.kpi-big .number-view-content strong { font-size: 2.5rem; color: var(--primary-color);}.kpi-big .card-dashboard__title { font-weight: 600;}Tint records that are waiting at a step
Section titled “Tint records that are waiting at a step”- Workflow step style › your step › General:
step-waiting - View style › General:
& tr.step-waiting > td { background: color-mix(in srgb, var(--primary-color) 8%, transparent);}& .face-kanban-view .step-waiting { border-inline-start: 4px solid var(--primary-color);}Frame a button’s dialog
Section titled “Frame a button’s dialog”- Button dialog style › your button › Ask User For:
confirm-dialog - View style › Ask User For:
.confirm-dialog { border-inline-start: 4px solid var(--primary-color);}Let long values wrap on narrow screens
Section titled “Let long values wrap on narrow screens”- Fields style › your field › Details:
long-value - View style › Details:
@media (max-width: 640px) { .long-value { white-space: normal; overflow-wrap: anywhere; }}Colour records by tag
Section titled “Colour records by tag”You can colour records without writing CSS. Entry classification styles colour a record’s background or its border by a tag, and can show tags on each record. A tag comes from a query: it marks the records the query matches. Create the tags first. See Colour matching records: tags.
- Open the view, and stay on the Settings tab.
- Make sure the Entries list is switched on. Scroll to Entry classification styles.
- Under Background color, choose a Selected option: the tag whose colour fills the background of the records it matches.
- To let people switch to another tag, tick Allow Changing, then choose the tags they may pick from in Options.
- Do the same under Border color. The tag’s colour then marks the record’s border instead.
- Under Tags, choose one or more tags to show on each record. Tick Allow Changing and fill Options to let people choose.
- Save the view.
When Allow Changing is on, people switch styles in the list’s View Settings panel, under Style.
Use classification styles when the colour follows a rule about the data, such as “overdue” or “high priority”. Use workflow step style when the colour follows the record’s workflow step. Use custom CSS for everything else.
Style a page and its widgets
Section titled “Style a page and its widgets”Pages have their own styling, separate from views. See Pages & Widgets.
- Additional CSS, in the page’s settings, takes CSS. OSOS wraps it in the
page’s content area (
.w_visual_container) in the same way as View style. Plain declarations style the page area, and nested rules style what is inside it. - Custom CSS Classes, in a widget’s settings, takes class names. Turn it on and type the classes. OSOS adds them to the widget’s container. Style them from the page’s Additional CSS:
.key-figure { border: 1px solid var(--surface-d); border-radius: 8px; background: var(--surface-a);}Troubleshooting
Section titled “Troubleshooting”| Problem | What to check |
|---|---|
| My CSS has no effect. | You may have typed CSS in a class-name box, or class names in a View style box. CSS goes only in View style. |
| A rule works on the list but not on the record. | The rule is in a face box, such as Table view. Move it to General, or repeat it in Details. |
| A rule changed another view on the same page. | Face, details and form boxes share their wrapper class across views. Move the rule into General. |
| A field class does not appear on a screen. | The class is in another screen’s box. Put it in General to add it everywhere. |
| Text is unreadable in the dark theme. | Replace hard-coded colours with theme variables. |
| A margin is on the wrong side in Arabic. | Use logical properties (margin-inline-start) instead of left and right. |
See also
Section titled “See also”- Data Views & Faces: where custom styles sit among the view’s settings.
- Queries: colour matching records with tags
- Pages & Widgets
- Override mobile app colours per view and page
- Brand the platform
- Run JavaScript on forms and lists
Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27