Theming

Fundamentals > Theming
Shallow Focus Photography of Paintbrush - Photo by Daian Gan: https://www.pexels.com/photo/shallow-focus-photography-of-paintbrush-102127/
The Responsive UI theming styles all aspects of your application's component visuals, using CSS.

The Responsive UI theming styles all aspects of the component visuals, using CSS.

Your application’s views are built without knowledge of the current theme. The current theme styles all of the elements within your application’s views automatically, freeing you from having to worry about coming up with color schemes.

Your application-level CSS should never hardcode colors since those colors may conflict with the Responsive UI theming, and might not even be visible in some of the theme color sets.

Available themes

Responsive UI supports 10 enterprise themes…

Pacific

Pacific theme

Onyx

Onyx theme

Contrast

Contrast theme

Steel

Steel theme

Chocolate

Chocolate theme

Pear

Pear theme

Tangerine

Tangerine theme

Grape

Grape theme

Rose

Rose theme

Terminal

Terminal theme

Open theming with CSS variables

Responsive UI uses CSS variables to provide all themed values. These CSS variables are mostly specify color values, but they also include settings for font, border radius, box shadows, etc.

The name for each CSS variable starts with two hyphens and describes the value it contains. For example, the themed value for the primary button background color can be found in the --btn-primary-bg CSS variable and the value for button text font weight can be found in the --btn-font-weight CSS variable.

To reference, say, the themed primary button background color, use this notation in your CSS:

var(--btn-primary-bg)

The binding of the values from the CSS variables happens at runtime. This allows you to reference all themed colors as standalone values that you can then assign to any property in any element, including your own components or any third-party components you want to use that are not officially supported in Responsive UI.

This returns the value for just this one themed color, not an assignment of that color to a specific property. This is important, because it allows you to grab just the color value in isolation, which you can then use in any way you like.

You’ll typically reference these CSS variables in your own CSS classes like what’s shown below, mapping the CSS variable value to any property that takes the same data type. This example takes a specific themed color value — one that’s typically used as a background color — and uses that as a border color.

.my-component {
    border: 1px solid var(--btn-primary-bg);
}

Whenever the theme changes, a new set of CSS variables for the selected theme is loaded into the DOM, automatically updating any CSS variable references like the one shown above. This allows you to reference our themed color values and apply them to elements in your application in a theme safe way.

Most of the themed values are color values. If you apply only a color value to text, you won’t get the correct font face, font size, font weight, etc. There are new CSS variables for these settings too, and there’s a good chance we’ll be adding more CSS variables over time too.

Using CSS variables for our theming also opens the ability for anyone to create new themes, including custom themes and FI-branded themes. We do not have a theme generator utility at this point, so custom theme creation would be a manual process, but it is possible.

CSS variable example in sample application

You can see an example of CSS variable usage in the Theming pattern view in the sample application.

List of available CSS variables

This section lists the CSS variables that are available for you to reference in your applications.

VARIABLE DESCRIPTION
–accent Accent color; typically used to indicate that a sub-element is clickable
–body-bg Background color behind function view
–box-shadow Base color for all drop shadows
–box-shadow-display-block Drop shadow for display blocks
–box-shadow-floating-toolbar Drop shadow for floating toolbar
–box-shadow-form-control Drop shadow for form elements (inset)
–box-shadow-header Drop shadow for the main header
–box-shadow-menu-header Drop shadow for header menus
–box-shadow-menu-nav Drop shadow for nav menus
–box-shadow-popup Drop shadow for popups
–breadcrumb Foreground color for breadcrumbs above the function title
–breadcrumb-display-block Foreground color for breadcrumbs in the content
–breadcrumb-separator Foreground color for breadcrumb separators above the function title
–breadcrumb-separator-display-block Foreground color for breadcrumb separators in the content
–btn-badge-bg-destructive Badge background color for destructive buttons
–btn-badge-bg-primary Badge background color for primary buttons
–btn-badge-bg-secondary Badge background color for secondary buttons
–btn-badge-border-radius Border radius for badges
–btn-badge-border-style Border stye for badges
–btn-badge-border-width Border width for badges
–btn-badge-fg-destructive Badge foreground color for destructive buttons
–btn-badge-fg-primary Badge foreground color for primary buttons
–btn-badge-fg-secondary Badge foreground color for secondary buttons
–btn-badge-font-size Badge font size
–btn-badge-font-weight Badge font weight
–btn-badge-line-height Badge line height
–btn-badge-min-width Badge minimum width
–btn-badge-padding Badge padding
–btn-badge-right Badge offset from right edge of button
–btn-badge-top Badge offset from top edge of button
–btn-border-radius Border radius for buttons
–btn-border-style Border style for buttons
–btn-border-width Border thickness for buttons
–btn-box-shadow Drop shadow for buttons
–btn-destructive-bg Destructive button background color
–btn-destructive-bg-active Destructive button background color when pressed
–btn-destructive-bg-disabled Destructive button background color when disabled
–btn-destructive-bg-hover Destructive button background color when hovered
–btn-destructive-border Destructive button border color
–btn-destructive-border-disabled Destructive button border color when disabled
–btn-destructive-fg Destructive button foreground color
–btn-destructive-fg-disabled Destructive button foreground color when disabled
–btn-destructive-fg-hover Destructive button foreground color when hovered
–btn-font-size-md Font size for medium buttons
–btn-font-size-sm Font size for small buttons
–btn-font-weight Font weight for buttons
–btn-line-height-md Line height for medium buttons
–btn-line-height-sm Line height for small buttons
–btn-misc-bg Background color for clickable tags and active toggle buttons and button group buttons
–btn-misc-bg-hover Background hover color for clickable tags and active toggle buttons and button group buttons
–btn-misc-fg Foreground color for clickable tags and active toggle buttons and button group buttons
–btn-misc-fg-hover Foreground hover color for clickable tags and active toggle buttons and button group buttons
–btn-padding-md Padding for medium buttons
–btn-padding-sm Padding for small buttons
–btn-primary-bg Primary button background color – rest state
–btn-primary-bg-active Primary button background color – active state
–btn-primary-bg-disabled Primary button background color – disabled state
–btn-primary-bg-hover Primary button background color – hover state
–btn-primary-border Primary button border color
–btn-primary-border-disabled Primary button border color – disabled state
–btn-primary-fg Primary button foreground color – rest state
–btn-primary-fg-disabled Primary button foreground color – disabled state
–btn-primary-fg-hover Primary button foreground color – hover state
–btn-secondary-bg Secondary button background color – rest state
–btn-secondary-bg-active Secondary button background color – active state
–btn-secondary-bg-disabled Secondary button background color – disabled state
–btn-secondary-bg-hover Secondary button background color – hover state
–btn-secondary-border Secondary button border color
–btn-secondary-border-disabled Secondary button border color – disabled state
–btn-secondary-fg Secondary button foreground color – rest state
–btn-secondary-fg-disabled Secondary button foreground color – disabled state
–btn-secondary-fg-hover Secondary button foreground color – hover state
–busy-indicator Busy indicator spinner color
–busy-indicator-backdrop Busy indicator backdrop color
–chart-data-series-color-1 Chart data series color 1
–chart-data-series-color-2 Chart data series color 2
–chart-data-series-color-3 Chart data series color 3
–chart-data-series-color-4 Chart data series color 4
–chart-data-series-color-5 Chart data series color 5
–chart-data-series-color-6 Chart data series color 6
–chart-data-series-color-7 Chart data series color 7
–chart-data-series-color-8 Chart data series color 8
–chart-data-series-color-9 Chart data series color 9
–chart-data-series-color-10 Chart data series color 10
–chart-data-series-translucent-color-1 Chart data series color 1 – with translucence
–chart-data-series-translucent-color-2 Chart data series color 2 – with translucence
–chart-data-series-translucent-color-3 Chart data series color 3 – with translucence
–chart-data-series-translucent-color-4 Chart data series color 4 – with translucence
–chart-data-series-translucent-color-5 Chart data series color 5 – with translucence
–chart-data-series-translucent-color-6 Chart data series color 6 – with translucence
–chart-data-series-translucent-color-7 Chart data series color 7 – with translucence
–chart-data-series-translucent-color-8 Chart data series color 8 – with translucence
–chart-data-series-translucent-color-9 Chart data series color 9 – with translucence
–chart-data-series-translucent-color-10 Chart data series color 10 – with translucence
–chart-grid-color Chart grid line color
–content-primary-bg Primary content background color, used as the backdrop for display blocks and group boxes
–content-secondary-bg Secondary content background color, used as the background for dialog box button bar, non-clickable tags, pre blocks, etc
–display-block-border-color Display block border color
–display-block-border-width Display block border width
–display-block-subtitle-opacity Display block subtitle opacity
–font-family Font family fallback list
–font-size Typical font size
–font-weight Typical font weight
–form-disabled-bg Background color for disabled form elements
–form-disabled-fg Foreground color for disabled form elements
–form-required-field Color for the required field indicator (asterisk)
–function-title Function title text color
–grid-btn-fg-disabled Disabled grid button foreground color
–group-box-subtitle-opacity Group box subtitle opacity
–line Lighter border color, used for group boxes, form elements, subheaders, and tab bars
–line-heavy Heavier border color, used for checkboxes
–line-height Typical line height
–list-item-hovered-bg Background color for hovered list items
–list-item-hovered-fg Foreground color for hovered list items
–list-item-selected-bg Background color for selected list items
–list-item-selected-fg Foreground color for selected list items
–main-header-bg Background color of header
–main-header-bg-hover Hover background color of header elements
–main-header-border-bottom Bottom border color of header
–main-header-fg Foreground color for header elements
–main-header-height Header height
–main-nav-bg Background color of nav bar
–main-nav-bg-active Background color of active nav element
–main-nav-border Border color of nav bar
–main-nav-fg-active Foreground color for active nav element
–main-nav-fg-inactive Foreground color for inactive nav elements
–main-nav-separator Line color for nav bar separators
–main-nav-width-collapsed Nav bar width: collapsed
–main-nav-width-expanded Nav bar width: expanded
–modal-backdrop Background color for backdrop displayed behind modals
–modal-border Border displayed around modals
–notification-error-accent Accent color for Error notifications
–notification-error-bg Background color for Error notifications
–notification-error-border Border color for Error notifications
–notification-error-close-btn Close button color for Error notifications
–notification-error-fg Foreground color for Error notifications
–notification-info-accent Accent color for Information notifications
–notification-info-bg Background color for Information notifications
–notification-info-border Border color for Information notifications
–notification-info-close-btn Close button color for Information notifications
–notification-info-fg Foreground color for Information notifications
–notification-success-accent Accent color for Success notifications
–notification-success-bg Background color for Success notifications
–notification-success-border Border color for Success notifications
–notification-success-close-btn Close button color for Success notifications
–notification-success-fg Foreground color for Success notifications
–notification-warning-accent Accent color for Warning notifications
–notification-warning-bg Background color for Warning notifications
–notification-warning-border Border color for Warning notifications
–notification-warning-close-btn Close button color for Warning notifications
–notification-warning-fg Foreground color for Warning notifications
–outline-offset-anchor Distance between anchor elements and their focus outline
–outline-offset-btn Distance between button elements and their focus outline
–outline-style Focus outline style
–outline-width Focus outline width
–password-strength-meter-medium-bg Background color for medium-strength password strength meters
–password-strength-meter-strong-bg Background color for strong-strength password strength meters
–password-strength-meter-text-shadow Text shadow for password strength meter text
–password-strength-meter-weak-bg Background color for weak-strength password strength meters
–percentage-circle-data-active Background color for the active section in percentage circles
–percentage-circle-data-bg Background color for the center section behind the text in percentage circles
–percentage-circle-data-inactive Background color for the inactive section in percentage circles
–popup-bg Background color for popups
–popup-border Border color for popups
–popup-border-radius Border radius for popups
–popup-fg Foreground color for popups
–popup-content-bg Background color for popups with user content
–popup-content-border Border color for popups with user content
–popup-content-fg Foreground color for popups with user content
–popup-header-separator Color for popup separators (in header dropdowns)
–popup-menu-option-padding Padding for popups
–popup-menu-separator Color for popup separators
–scrollbar-thumb Background color for function view scrollbar thumb
–scrollbar-track Background color for function view scrollbar track
–search-box-bg Background color for header search box
–search-box-border Border color for header search box
–search-box-button-bg Background color for search button in header search box
–search-box-button-bg-hover Background color for search button in header search box when hovered
–search-box-button-fg Foreground color for search button in header search box
–search-box-button-fg-hover Foreground color for search button in header search box when hovered
–search-box-fg Foreground color for header search box
–search-box-watermark Watermark color for header search box
–slide-up-bg Background color for slide-ups
–slider-thumb Background color for slider thumb
–slider-thumb-focused Background color for slider thumb when focused
–slider-track Background color for slider track
–splitter-bg Color for splitters between display blocks using fixed layout
–table-footer-bg Background color for footers in responsive tables and grids that use the striped appearance
–table-header-bg Background color for headers in responsive tables and grids that use the striped appearance
–table-stripe-bg Background color for alternating rows in responsive tables and grids that use the striped appearance
–table-stripe-fg Foreground color for alternating rows in responsive tables and grids that use the striped appearance
–text-bright Color for bright text
–text-disabled Color for disabled text
–text-error Color for error text
–text-help Color for help text
–text-highlight Background color behind highlighted record detail rows
–text-regular Color for regular text
–tile-alt1-bg Background color for tiles with the Alternate1 appearance
–tile-alt1-bg-hover Background color for tiles with the Alternate1 appearance when hovered
–tile-alt1-fg Foreground color for tiles with the Alternate1 appearance
–tile-alt2-bg Background color for tiles with the Alternate2 appearance
–tile-alt2-bg-hover Background color for tiles with the Alternate2 appearance when hovered
–tile-alt2-fg Foreground color for tiles with the Alternate2 appearance
–tile-alt3-bg Background color for tiles with the Alternate3 appearance
–tile-alt3-bg-hover Background color for tiles with the Alternate3 appearance when hovered
–tile-alt3-fg Foreground color for tiles with the Alternate3 appearance
–tile-highlighted-bg Background color for tiles with the Highlighted appearance
–tile-highlighted-bg-hover Background color for tiles with the Highlighted appearance when hovered
–tile-highlighted-fg Foreground color for tiles with the Highlighted appearance
–toast-bg Background color for popup notifications
–toast-close-button-border Border color for buttons in popup notifications
–toast-close-button-fg Foreground color for buttons in popup notifications
–toast-fg Foreground color for popup notifications
–toggle-thumb-bg Background color for toggle thumb
–toggle-track-border Border color for toggle track
–toolbar-floating-bg Background color for floating toolbar
–toolbar-function-bg Background color for function toolbar
–toolbar-separator-bg-function Color for function toolbar separators
–well-bg Background color for wells
–well-border Border color for wells

Support options
Have questions on this topic?
Join the Responsive UI team in Microsoft Teams to connect with the community.
See something in this page that needs to change?
Send us feedback on this page.
Last updated Wed Mar 29 2023