Skip to content

Calcite variables in ArcGIS Instant Apps

Santa Monica Trails

Santa Monica Trails web app created with ArcGIS Instant Apps.

You can enhance your web apps without writing complex CSS. ArcGIS Instant Apps uses the Calcite Design System to help you build consistent, branded applications with just a few variable changes. By customizing Calcite variables, you can quickly adjust colors, typography, and spacing to match your organization's style.

How it works

Calcite variables act as design tokens that control the appearance of your instant app. Here's how to use them:

  1. Create an instant app

    • Choose a template that supports custom CSS (see template support)
    • Start with a basic layout that matches your needs
  2. Add custom CSS

    • Open the Custom CSS window
    • Override Calcite variables to match your brand
    • Use the variables to ensure consistency across your app
  3. Preview and refine

    • Test your changes in different screen sizes
    • Use browser developer tools to experiment with values
    • Ensure good contrast and readability

Examples

The above Active Hurricanes, Cyclones, and Typhoons demo web application was created using the sidebar template. One of the common workflows is to style the sidebar of the application.

Custom CSS

Below are high-level instructions on how to customize the action bar Calcite component of in a sidebar template.

  1. Disable Express mode.

  2. Click Search settings and enter Custom CSS. You will be navigated to the Theme settings.

  3. Click Edit. A Custom CSS window will then be displayed, allowing custom CSS to be added.

  4. Add the CSS code below:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Dark theme customization */
.calcite-mode-dark {
    /* Brand colors for primary actions */
    --calcite-ui-brand: #d6b9eb;
    --calcite-ui-brand-hover: #c59cd6;
    --calcite-ui-brand-press: #b399c4;

    /* Background colors for layout */
    --calcite-ui-background: #3e3342;
    --calcite-ui-foreground-1: #2e2933;
    --calcite-ui-foreground-2: #2b262c;
    --calcite-ui-foreground-3: #1b181b;

    /* Status colors for feedback */
    --calcite-ui-info: #be3dc4;
    --calcite-ui-success: #28d258;
    --calcite-ui-warning: #ff9900;
    --calcite-ui-danger: #fe3e7e;
    --calcite-ui-danger-hover: #ff004c;
    --calcite-ui-danger-press: #db005b;

    /* Text colors for content */
    --calcite-ui-text-1: #fef2ff;
    --calcite-ui-text-2: #fef5ff;
    --calcite-ui-text-3: #faf0f9;
    --calcite-ui-text-inverse: #1a0416;
    --calcite-ui-text-link: #872686;

    /* Border colors for separation */
    --calcite-ui-border-1: #373239;
    --calcite-ui-border-2: #413941;
    --calcite-ui-border-3: #463e47;
    --calcite-ui-border-input: #49434c;
}
  1. Click Close to run the CSS code.

The Calcite variables above were used to override the .calcite-mode-dark theme of the web application. The override rules were generated in the action bar sample application.

The above Primary Care Providers in Bellingham, WA demo web application was created using the Nearby template. One of the common workflows is to style the nearby results of the application.

Custom CSS

Below is an example of custom CSS that was used to style the nearby results of the application. The CSS code renders every other Calcite block of the nearby results of hospitals in a light gray color.

  1. Click Search settings and enter Custom CSS. You will be navigated to the Theme settings.

  2. Click Edit. A Custom CSS window will then be displayed, allowing custom CSS to be added.

  3. Add the CSS code below:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
.feature-group-container:nth-child(even) {

    calcite-block , .esri-feature , calcite-action {
        --calcite-block-header-background-color: #D3D3D3;
        --calcite-block-header-background-color-hover: #D3D3D3;
        --calcite-block-header-background-color-press: #D3D3D3;
        background-color: #D3D3D3;
    }
    calcite-block > nav > calcite-action {
        --calcite-action-background-color:#D3D3D3;
    }
}

This CSS improves the readability of nearby results by creating a zebra-striping effect. It targets even-numbered containers (:nth-child(even)) and applies a light gray background (#D3D3D3) to their components. The styling affects three key elements:

  • The Calcite block headers (normal, hover, and pressed states)
  • The feature content display area
  • The action buttons within the navigation

This pattern helps users distinguish between different results in the list, especially when viewing multiple locations.

Color variables

Calcite Design System provides light and dark modes to apply to an Instant Apps web application. Below are several Calcite variables that can be used in an Instant Apps web application.

Light mode

NameValue
--calcite-ui-brand
#007ac2
--calcite-ui-brand-press
#004874
--calcite-ui-brand-hover
#00619B

Dark mode

NameValue
--calcite-ui-brand
#009AF2
--calcite-ui-brand-press
#00619B
--calcite-ui-brand-hover
#007AC2

Font family

Listed below are two Calcite Design System global variables for font family.

NameValue
--calcite-code-family"Consolas", "Andale Mono", "Lucida Console", "Monaco", monospace
--calcite-sans-family"Avenir Next", "Avenir", "Helvetica Neue", sans-serif

Font sizes

Several Calcite variables for font sized are listed below.

NameValue
--calcite-font-size-01rem or 16px
--calcite-font-size-11.124rem or 18px
--calcite-font-size-21.25rem or 20px
---calcite-font-size-31.625rem or 26px

Template support

Listed are templates that support Calcite variables:

Calcite variables support
3D Viewer
Attachment Viewer
Basic
Category Gallery
Chart Viewer
Countdown
Exhibit
Imagery Viewer
Insets
Interactive Legend
Media Map
Nearby
Portfolio
Sidebar
Slider
Zone Lookup
Full supportPartial supportNo support

    Tutorials

    Use tools to create different types of content and build low-code/no-code applications.

    Learn more on creating web apps using ArcGIS Instant Apps.

    Tools

    Use tools to access the ArcGIS organization and create and manage content for your no-code applications.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.