Customising AdapTable Themes
Summary
- Customise the shipped
lightanddarkthemes with CSS variable overrides in your stylesheet (--ab-*,--ab__*) - Recommended: tune on a live Grid with DevTools — Theme Builder, then paste exported CSS into
:root.ab--theme-light/:root.ab--theme-dark - Two handbook approaches — key theme variables and component variables / selectors — each with a demo below
Find Out More
System themes, runtime selection, and AG Grid coordination — Theming AdapTable UI.
Topics on this Page
| Topic | Summary |
|---|---|
| Two approaches | Key variables vs component tuning |
| Key theme variables | Colours, spacing, fonts, palette |
| Component variables | --ab-cmp-*, selectors, date picker, Expression Editor |
| Referencing in objects | var(--ab-color-…) in Adaptable Styles |
Recommended workflow
- Install AdapTable DevTools and open Theme Builder on your Grid.
- Adjust tokens and preview Dashboard, Settings Panel, and wizards.
- Export CSS into your app's global stylesheet (see selectors below).
- Optionally reference the same variables in Format Columns — Referencing Theme Variables.
AdapTable provides light, dark, and os system themes. Override the variables that make up light and dark when the defaults are not quite right.
Note
- You do not need to fork the theme files to achieve this
- Simply import the shipped theme and layer your overrides on
:root.ab--theme-lightand:root.ab--theme-dark
Two approaches
There are two main conceptual approaches to customising an AdapTable theme:
Hint
- It is possible to choose either or both approaches in the same Theme override
- Our advice is to start with approach 1 and add 2 only where you need more control
| Approach | What Changes | Typical Use | Examples |
|---|---|---|---|
| 1. Key theme variables | Core colours, spacing, fonts, color palette | Brand colours and typography that flow through Dashboard, toolbars, panels, and wizards | --ab-color-accent--ab-color-primary--ab-base-space ... |
| 2. Component variables and selectors | Per-component variables and targeted CSS classes | Fine-tune one area — e.g. hide toolbar button, restyle wizard section, theme date picker or Expression Editor | --ab-dashboard-header__background--ab-cmp-datepicker__--ab-cmp-aql-editor__*.ab-OnePageWizard__… |
Find Out More
- You can also reference theme CSS variables in Format Columns, Conditional Styles, and other Adaptable Styles
- This includes using shipped defaults and without customising the theme first - see Referencing Themes
Key Theme Variables
AdapTable contains many CSS variables.
Typically only a few, usually regarding colours, fonts and spacing, are required when modifying a Theme.
For this reason, most users make changes to CSS variables incrementally and work their way up as needed.
Hint
DevTools — Theme Builder changes variables on the live Grid and exports CSS for your repository — use it before maintaining large override tables by hand.
Theme Colours
These are the core theme colours that differ between the light and dark themes (i.e. the --ab-color-* variables that AdapTable overrides in its dark theme).
Setting these is usually all you need to create a coherent custom theme.
Note
We show here the default AdapTable values in the light and dark Themes.
| Variable | Where Used | Light | Dark |
|---|---|---|---|
| --ab-color-accent | Back Colour in Dashboard and Panel Headers | (#07c) | (#07c) |
| --ab-color-accent-foreground | Font Colour in Dashboard and Panel Headers | (#e2e2e2) | (#e2e2e2) |
| --ab-color-background | App-wide background; colours most UI controls | (white) | (#474c52) |
| --ab-color-foreground | App-wide font colour used in most UI controls | (#656565) | (#e2e2e2) |
| --ab-color-primary | Colour of Toolbars and Toolpanels | (#e9e9e9) | (#262d2f) |
| --ab-color-primary-foreground | Font colour where primary colour is background | (#656565) | (#e2e2e2) |
| --ab-color-primarylight | Colours Dashboard and most Panels | (#f5f5f5) | (#3d3e3f) |
| --ab-color-primarydark | Border colour for most UI Controls | (#b7b7b7) | (#1c2021) |
| --ab-color-card | Background for Cards and floating panels | (#f5f5f5) | (#51555a) |
| --ab-color-card-foreground | Font colour used on Cards | (#656565) | (#e2e2e2) |
| --ab-color-secondary | Secondary surfaces | (oklch(0.97 0 0)) | (oklch(0.269 0 0)) |
| --ab-color-secondary-foreground | Font colour on secondary surfaces | (oklch(0.205 0 0)) | (oklch(0.985 0 0)) |
| --ab-color-border | Border colour for many UI controls | (oklch(0.922 0 0)) | (oklch(0.269 0 0)) |
| --ab-color-destructive | Error states and destructive actions | (#dc3545) | (oklch(0.396 0.141 25.723)) |
| --ab-color-destructive-foreground | Font colour on the destructive background | (white) | (oklch(0.637 0.237 25.331)) |
| --ab-color-shadow | Colours shadows and the backdrop behind popups | (rgb(0 0 0 / 0.2)) | (rgb(255 255 255 / 0.45)) |
Other Key Colours
There are a number of other core, colour-related variables that can be used when setting a theme.
Note
All these colour variables have the same value in both AdapTable's light and dark themes
| Variable | Description | Value |
|---|---|---|
| --ab-color-accentlight | Shadow for Toggle Buttons | (#dbf0ff) |
| --ab-color-ring | Colour of the focus ring (defaults to accent) | (#07c) |
| --ab-color-warn | Used in Warning Messages & Notifications | (#eb9316) |
| --ab-color-warn-foreground | Font colour for Warning Messages | (white) |
| --ab-color-info | Used in Info Messages & Notifications | (#17a2b8) |
| --ab-color-info-foreground | Font colour for Info Messages | (white) |
| --ab-color-success | Used in Success Messages & Notifications | (#419641) |
| --ab-color-success-foreground | Font colour for Success Messages | (white) |
| --ab-color-action-edit | Colour of Edit Button | (#17a2b8) |
| --ab-color-action-edit-foreground | Font Colour for Edit Button | (white) |
| --ab-color-action-share | Colour of Share Button | (#eb9316) |
| --ab-color-action-share-foreground | Font Colour for Share Button | (white) |
| --ab-color-action-delete | Colour of Delete Button | (#dc3545) |
| --ab-color-action-delete-foreground | Font Colour for Delete Button | (white) |
| --ab-color-action-clone | Colour of Clone Button | (#419641) |
| --ab-color-action-clone-foreground | Font Colour for Clone Button | (white) |
Module Colours
Some AdapTable Modules paint cells with a default colour as part of a feature.
Each of these default colours has its own variable, so it can be themed separately:
Note
- These variables are what AdapTable writes into the object (e.g. Flashing Cell or Badge)
- As a result, the object reuses the same theme variable after it is persisted and reloaded
| Variable | Used for | Default |
|---|---|---|
| --ab-color-flash-up | Flashing Cell when a value rises | --ab-color-success(#419641) |
| --ab-color-flash-down | Flashing Cell when a value falls | --ab-color-destructive(#dc3545) |
| --ab-color-flash-neutral | Flashing Cell for neutral value | (#808080) |
| --ab-color-quick-search-match | Quick Search highlight matching text | (#ffff00) |
| --ab-color-quick-search-match-foreground | Text colour of a Quick Search match | (#000000) |
| --ab-color-quick-search-current-match | Highlights current Quick Search match | --ab-color-warn(#eb9316) |
| --ab-color-quick-search-current-match-foreground | Text colour of current Quick Search match | (#000000) |
| --ab-color-badge | Background of a new Badge | --ab-color-primary(#e9e9e9) |
| --ab-color-badge-foreground | Text colour of a new Badge | --ab-color-primary-foreground(#656565) |
| --ab-color-range-default | Colour of a new range in Range Bar, Bullet and Ranges styled columns | (#808080) |
Hint
- They are independent of the Colour Palette below
- Changing a Palette colour never changes a feature default, and vice versa
Colour Palette
The 2 shipped Themes also contain the colours of the Colour Palette: --ab-color-palette-1, --ab-color-palette-2, … (32 by default).
Note
These colours exist only to populate the Colour Picker; no AdapTable feature uses them as a default
The first 12 differ in light and dark.
Note
- These can be categorised into 6 pairs with background and matching foreground
- They are used for error, warn, success, info, neutral, and accent respectively
| Colour | Typical Use | Light Theme | Dark Theme |
|---|---|---|---|
--ab-color-palette-1 | Error / breach highlight | (#fde8e8) | (#5c1a1a) |
--ab-color-palette-2 | Error / breach highlight | (#9b2c2c) | (#ffb4b4) |
--ab-color-palette-3 | Warning / pending highlight | (#fff8e1) | (#4a3b00) |
--ab-color-palette-4 | Warning / pending highlight | (#975a16) | (#ffd966) |
--ab-color-palette-5 | Success / booked highlight | (#e6f4ea) | (#1b4332) |
--ab-color-palette-6 | Success / booked highlight | (#276749) | (#95d5b2) |
--ab-color-palette-7 | Informational highlight | (#e6f2ff) | (#1a365d) |
--ab-color-palette-8 | Informational highlight | (#2b6cb0) | (#90cdf4) |
--ab-color-palette-9 | Neutral / inactive highlight | (#edf2f7) | (#2d3748) |
--ab-color-palette-10 | Neutral / inactive highlight | (#4a5568) | (#e2e8f0) |
--ab-color-palette-11 | Accent / stage highlight | (#f3e8ff) | (#44337a) |
--ab-color-palette-12 | Accent / stage highlight | (#553c9a) | (#d6bcfa) |
Hint
Typically you will want to override both items in a pair
The next 20 are plain colours with the same defaults in light and dark:
| Variable | Default (light & dark) |
|---|---|
--ab-color-palette-13 | (#000000) |
--ab-color-palette-14 | (#FFFFFF) |
--ab-color-palette-15 | (#D3D3D3) |
--ab-color-palette-16 | (#808080) |
--ab-color-palette-17 | (#A52A2A) |
--ab-color-palette-18 | (#006400) |
--ab-color-palette-19 | (#008000) |
--ab-color-palette-20 | (#32CD32) |
--ab-color-palette-21 | (#FFFF00) |
--ab-color-palette-22 | (#FFFFE0) |
--ab-color-palette-23 | (#00008B) |
--ab-color-palette-24 | (#0000FF) |
--ab-color-palette-25 | (#87CEFA) |
--ab-color-palette-26 | (#00FFFF) |
--ab-color-palette-27 | (#FF00FF) |
--ab-color-palette-28 | (#800080) |
--ab-color-palette-29 | (#8B0000) |
--ab-color-palette-30 | (#FF0000) |
--ab-color-palette-31 | (#DC143C) |
--ab-color-palette-32 | (#FFA500) |
Which colours the Colour Picker offers from this list is userInterfaceOptions.colourPickerOptions.filterColours. Which tabs it shows, and their order, is userInterfaceOptions.colourPickerOptions.tabs (Custom, Palette, or both).
Find Out More
See the UI Guide on providing a Custom Colour Palette for replacing, extending or restricting the palette
Spacing
All spacing in AdapTable is based on the --ab-base-space variable.
This defaults to 4px.
Spacing in the application is derived from this value using calc() (e.g. calc(var(--ab-base-space) * 2)).
Hint
You can uniformly adjust all spacing by overriding the value of --ab-base-space
Font Sizes
AdapTable also supports a scale for font size, providing 8 different font sizes.
These are derived from --ab-base-font-size (which defaults to 1rem) and are used as follows:
| Font Size | Calculation | Rem Equivalent | Preview |
|---|---|---|---|
| --ab-font-size-0 | calc(var(--ab-base-font-size) * 0.5) | 0.5 rem | Preview |
| --ab-font-size-1 | calc(var(--ab-base-font-size) * 0.625) | 0.625 rem | Preview |
| --ab-font-size-2 | calc(var(--ab-base-font-size) * 0.75) | 0.75 rem | Preview |
| --ab-font-size-3 | calc(var(--ab-base-font-size) * 0.875) | 0.875 rem | Preview |
| --ab-font-size-4 | var(--ab-base-font-size) | 1 rem | Preview |
| --ab-font-size-5 | calc(var(--ab-base-font-size) * 1.25) | 1.25 rem | Preview |
| --ab-font-size-6 | calc(var(--ab-base-font-size) * 1.5) | 1.5 rem | Preview |
| --ab-font-size-7 | calc(var(--ab-base-font-size) * 2.25) | 2.25 rem | Preview |
Hint
In practice only --ab-font-size-2 and --ab-font-size-3 are used, so are the ones you are most likely to adjust
Font Family
By default AdapTable inherits the Font it will use.
This is done using the --ab__font-family CSS Variable which defaults to inherit.
Hint
Override this variable if you wish to specify a font to be used
- This demo overrides only key theme variables — no component-specific selectors
- Light theme: teal accent, cool grey toolbars, Georgia font, slightly wider spacing, teal palette colours
- Dark theme: slate-blue accent with a dark
--ab-color-accent-foreground(readable title on the pale header), Segoe UI font, different primary/background tones and picker colours - Two Module Colours are also overridden (same in both themes):
--ab-color-flash-upis orange,--ab-color-quick-search-matchis light brown - Watch
github_starstick for the orange flash-up; Quick Search is pre-filled with "Java" so the light-brown highlight is visible immediately - Use the Theme toolbar or status panel to switch between light and dark and compare the two brands
- Open Settings Panel to see primary/background colours on panels and wizards
- New Format Column → Style, then open a colour dropdown: the picker uses the branded
--ab-color-palette-*values for the active theme
Component Variables
Beyond the key variables above, every UI element exposes additional CSS variables.
In AdapTable these are typically prefixed with --ab-cmp- or scoped to a surface such as --ab-dashboard-header__background.
You can also target AdapTable CSS classes (e.g. .ab-Dashboard__title, .ab-OnePageWizard__section-title) when you need layout or visibility changes that variables alone cannot express.
Feedback
- We aim for comprehensive CSS-variable coverage so elements can meet bespoke requirements
- If something cannot be configured as you wish, please contact Support and we will rectify
- This demo applies component-level changes on top of the shipped light theme (
darkis unchanged) - Variables: dashboard header background, dashboard/panel gap colours, settings popup shadow, navigation separator
- Selectors: italic dashboard title; overline on toolbar labels; reversed wizard footer buttons; mint/chocolate wizard and tab styling
- Visibility:
New/Clonehidden in the Layout toolbar;Close/Configurehidden in the Export toolbar - Open Settings Panel (header button) and expand Layout / Export toolbars to see the effects
Styling Icons
Adaptable uses inline SVG for icons, since that's very performant and doesn't require any additional download.
However, you might want to style icons differently - in this case, you can customize that through css.
Every icon has the ab-Icon css class, and also ab-Icon--NAME where NAME is the name of the icon.
So for example, if you want to use a background image, you can do the following:
.ab-Icon--spanner path {
visibility: hidden; /* to hide the contents of the actual SVG */
}
.ab-Icon--spanner {
background-image: url(...);
background-size: cover;
}Using SASS
If you author theme overrides in Sass, use interpolation when assigning a Sass variable to a CSS custom property — the same rule applies to any --ab-* variable:
$panel-header-light: #fea7ff;
$panel-header-dark: #7a4d99;
:root.ab--theme-light {
--ab-cmp-dashboardpanel_header__background: #{$panel-header-light};
}
:root.ab--theme-dark {
--ab-cmp-dashboardpanel_header__background: #{$panel-header-dark};
}Date Picker
One control that is often themed with component variables is the Date Picker.
Note
This is used by AdapTable when editing or filtering date columns
- In this demo we provide a set of custom CSS Variables for the Date Picker
- We provide one set for each of the AdapTable System Themes: Light and Dark
Expression Editor
The Expression Editor used to write AdapTableQL Expressions has a dedicated set of custom variables.
The colours are theme variables (--ab-color-aql-*) and are editable in DevTools — Theme Builder; the editor chrome uses component variables (--ab-cmp-aql-editor__*).
Syntax Role Colours
The main theming variables create one colour for each syntax element in the Expression Editor:
Note
These differ between light and dark (except punctuation, which is derived from --ab-color-foreground)
| Variable | Where Used | Light | Dark |
|---|---|---|---|
| --ab-color-aql-token-column | Column refs ([colId], COL('id')) | (#1d4ed8) | (#93c5fd) |
| --ab-color-aql-token-function | Function names (SUM, CONCAT, …) | (#7c3aed) | (#d8b4fe) |
| --ab-color-aql-token-lookup | Lookup calls (QUERY, VAR) | (#0d9488) | (#2dd4bf) |
| --ab-color-aql-token-operator | Operators (+, =, AND, …) | (#b45309) | (#fdba74) |
| --ab-color-aql-token-number | Number and duration literals | (#0f766e) | (#5eead4) |
| --ab-color-aql-token-string | String literals | (#9a3412) | (#fdba74) |
| --ab-color-aql-token-keyword | Keywords (CASE, WHERE, TRUE, …) | (#a21caf) | (#f0abfc) |
| --ab-color-aql-token-punctuation | Brackets and commas | derived from --ab-color-foreground | derived from --ab-color-foreground |
Editor UI
Most of the variables used to create the Expression Editor itself default to core theme colours and can be overridden independently:
| Variable | Where Used | Default |
|---|---|---|
| --ab-cmp-aql-editor__background | Editor writing surface | var(--ab-color-background) |
| --ab-cmp-aql-editor__foreground | Default text / caret | var(--ab-color-foreground) |
| --ab-cmp-aql-editor__border | Editor border | var(--ab-color-primarydark) |
| --ab-cmp-aql-editor__selection | Text selection highlight | mix of --ab-color-accent |
| --ab-cmp-aql-editor__placeholder | Placeholder text | mix of --ab-color-foreground |
Column Identity Palette
There is a set of colours used to separately identify each column in an Expression.
Note
- When editing a Calculated Column, the square brackets for each referenced Column has its own colour
- The same colours are used in the Formula Editor - with the same defaults in light and dark
| Variable | Value |
|---|---|
| --ab-color-aql-ref-0 | (#ed7d31) |
| --ab-color-aql-ref-1 | (#a02b93) |
| --ab-color-aql-ref-2 | (#70ad47) |
| --ab-color-aql-ref-3 | (#c00000) |
| --ab-color-aql-ref-4 | (#ffc000) |
| --ab-color-aql-ref-5 | (#833c0c) |
| --ab-color-aql-ref-6 | (#548235) |
| --ab-color-aql-ref-7 | (#7030a0) |
The Formula Editor also uses --ab-color-formula-trace-source (default var(--ab-color-accent)) for the outline of the calculated cell being traced, and the component variables --ab-cmp-formula-trace__outline-width, --ab-cmp-formula-trace__outline-style, --ab-cmp-formula-trace__outline-offset and --ab-cmp-formula-trace__cell-tint for the outline and tint of the referenced cells.
- This demo customises Expression Editor CSS Variables for both the light and dark themes
- A live Grid Filter Expression opens automatically in the Expression Editor so you can see Columns, operators, strings and numbers in the new colours
- A Calculated Column (
Popularity Score) is also provided for editing a second Expression - Use the Theme toolbar or status panel to switch light / dark and compare the two override sets
- The Grid Filter Settings Panel opens on load — note the custom Column / operator / string colours in the Expression
- Click the Calculated Column module button (or status panel), then edit Popularity Score, to see the same overrides in another Editor
- Switch Theme between light and dark to compare both override sets
Referencing in objects
Referencing Theme Variables explains how Format Columns, Conditional Styles, and other objects use var(--ab-color-…) so one rule follows light and dark.
FAQ
Approach 1 or 2 first? Start with key theme variables for brand colours and typography; add component variables only where a single surface needs extra control.
Must I override both light and dark?
For a dual brand, yes — export or author separate blocks for :root.ab--theme-light and :root.ab--theme-dark.
Theme Builder vs this page? Theme Builder is for discovery and export; this page lists variables and patterns for checked-in CSS.