Skip to main content

AML Theme and Colors

Knowledge Checkpoint

A grasp of these concepts will help you understand this documentation better:

Dashboard themes in Holistics are defined using three AML objects: PageTheme, BlockTheme, and VizTheme. These can be declared inline in a dashboard file or in a shared file (e.g. themes.aml) for reuse across dashboards. Each object maps to a level in the dashboard visual hierarchy:

Theme component hierarchy
// Reusable theme declared in themes.aml
PageTheme my_theme {
color {
data: palette_name
}
canvas { ... }
block { ... }
viz { ... }
}

See Dashboard Themes for how-to guides on applying and creating themes.

PageTheme

PageTheme is the top-level theme object. It controls the full visual hierarchy of a dashboard: page background, canvas area, block styling, and visualization styling.

Parameter nameDescription
colorDefault color palette for all charts in the dashboard
backgroundBackground of the outer page viewport
canvasStyling for the main canvas area
blockDefault styling for all blocks
vizDefault styling for all visualizations
custom_cssCustom CSS injected into the dashboard

color

Sets the default color palette for all charts in the dashboard.

ParameterDescriptionAccepted values
dataThe color palette to use for chart data seriesA ColorPalette identifier defined in your project

background

Controls the outermost page container (the viewport surrounding the canvas).

ParameterDescriptionAccepted values
bg_colorBackground colorAny valid CSS <color> e.g. "#ffffff", "rgb(255 0 153)"
bg_imageBackground imageAny valid CSS <image> e.g. "https://...", "linear-gradient(blue, red)"
bg_repeatHow the background image repeatsfalse, true, "x", "y", "space", "round"
bg_sizeHow the background image is sized"cover", "contain"

canvas

Controls the primary reporting area that contains all dashboard blocks.

ParameterDescriptionAccepted values
border.*Canvas borderSee BorderTheme
background.*Canvas backgroundSee BgTheme
shadowCanvas shadow effect"none", "sm", "md", "lg"
opacityCanvas opacityNumber between 0 and 1

block

Default styling applied to all blocks in the dashboard. Can be overridden per block using BlockTheme.

ParameterDescriptionAccepted values
label.*Font styling for block titlesSee FontTheme
text.*Font styling for block text contentSee FontTheme
border.*Block borderSee BorderTheme
background.*Block backgroundSee BgTheme
paddingInternal block paddingNumber, String, or DetailedSpacing
shadowBlock shadow effect"none", "sm", "md", "lg"
opacityBlock opacityNumber between 0 and 1

viz

Default styling for data visualizations. Currently supports table-based visualizations (Data Table, Pivot Table, Metric Sheet) and KPI Metric.

viz.table

Note: Table styling has an override hierarchy: general styles are overridden by header, then sub_header, then sub_title.

ParameterDescriptionAccepted values
general.bg_colorTable body background colorAny valid color value e.g. "#ffffff"
general.hover_colorRow hover background colorAny valid color value
general.banding_colorAlternating row colorAny valid color value
general.font_sizeFont size for all table textNumber or String e.g. 12, "12px"
general.font_colorFont color for all table textAny valid color value
general.font_familyFont family for all table textAny valid font family name
general.border_colorTable outer border colorAny valid color value
general.border_widthTable border and grid line thicknessNumber or String
general.grid_colorTable grid line colorAny valid color value
header.bg_colorHeader background colorAny valid color value
header.font_sizeHeader font sizeNumber or String
header.font_colorHeader font colorAny valid color value
header.font_weightHeader font weight"light", "normal", "medium", "semibold", "bold", "extrabold"
sub_header.bg_colorPivot Table sub-header background colorAny valid color value
sub_header.font_sizePivot Table sub-header font sizeNumber or String
sub_header.font_colorPivot Table sub-header font colorAny valid color value
sub_header.font_weightPivot Table sub-header font weight"light", "normal", "medium", "semibold", "bold", "extrabold"
sub_title.font_sizeMetric Sheet subtitle font sizeNumber or String
sub_title.font_colorMetric Sheet subtitle font colorAny valid color value
sub_title.font_weightMetric Sheet subtitle font weight"light", "normal", "medium", "semibold", "bold", "extrabold"

viz.metric_kpi

ParameterDescriptionAccepted values
alignmentAligns all KPI Metric elements inside the visualization"left", "right", "center"
label.*Font styling for the KPI labelSee FontTheme
value.*Font styling for the KPI valueSee FontTheme
progress.text.*Font styling for the progress captionSee FontTheme
progress.indicator.*Background of the filled progress barSee BgTheme
progress.track.*Background of the progress bar trackSee BgTheme
trend.positive.text.*Font styling for positive trend textSee FontTheme
trend.positive.background.*Background of positive trend badgeSee BgTheme
trend.negative.text.*Font styling for negative trend textSee FontTheme
trend.negative.background.*Background of negative trend badgeSee BgTheme
trend.neutral.text.*Font styling for neutral trend textSee FontTheme
trend.neutral.background.*Background of neutral trend badgeSee BgTheme

custom_css

Injects custom CSS into the dashboard. Accepts any valid CSS code.

PageTheme my_theme {
custom_css: @css
.my-class { color: red; }
;;
}

See Custom CSS for details and examples.


BlockTheme

BlockTheme overrides the block styling from PageTheme for a specific block. It accepts the same parameters as the block section of PageTheme.

Dashboard my_dashboard {
block text_block: TextBlock {
theme: BlockTheme {
background {
bg_color: 'transparent'
}
}
}
}

VizTheme

Use theme { } inside any viz property to override its styling for that block. Accepts the same parameters as the viz section of PageTheme.

Dashboard my_dashboard {
block viz_block: VizBlock {
viz: PivotTable {
theme {
table {
general {
bg_color: 'white'
}
}
}
}
}
}
Dashboard my_dashboard {
block kpi_block: VizBlock {
viz: MetricKpi {
theme {
metric_kpi {
alignment: "center"
value {
font_color: "#1357A0"
font_weight: "bold"
}
trend {
positive {
background { bg_color: "#DCFCE7" }
}
negative {
background { bg_color: "#FEE2E2" }
}
}
}
}
}
}
}

ColorPalette

ColorPalette defines a named set of colors that can be applied to chart data series. Palettes are declared in .palette.aml files and referenced by name in the color block of PageTheme or project settings.

ParameterDescriptionAccepted values
titleDisplay name shown in the palette pickerString
categorical.colorsOrdered list of colors for chart data seriesArray of CSS color strings (hex, rgb, oklch, etc.)
ColorPalette my_palette {
title: "My Palette"
categorical {
colors: [
"#FF5733",
"#33FF57",
"#3357FF"
]
}
}

See Color Palettes for a full guide on creating and applying palettes.


Helper types

FontTheme

Used for text styling in blocks and visualizations.

PropertyDescriptionAccepted values
font_familyFont family. Learn moreString
font_sourceSource URL for a custom web font (used to load the font if not already available)String
font_sizeFont size (e.g. 14, "14px", "1rem")Number or String
font_colorFont colorString
font_weightFont weight"light", "normal", "medium", "semibold", "bold", "extrabold"
font_styleFont style"normal", "italic"
letter_spacingLetter spacingNumber or String
text_decorationText decoration"underline", "overline", "line-through"
text_transformText transform"uppercase", "lowercase", "capitalize"

BgTheme

Used for background styling in canvas, block, and KPI Metric progress bars and trend badges.

PropertyDescriptionAccepted values
bg_colorBackground colorString
bg_imageBackground imageString
bg_repeatHow the background image repeatsBoolean, "x", "y", "space", "round"
bg_sizeHow the background image is sized"cover", "contain"

BorderTheme

Used for border styling in canvas and block.

PropertyDescriptionAccepted values
border_widthBorder widthNumber, String, or DetailedSpacing
border_radiusCorner roundnessNumber, String, or DetailedRadius
border_colorBorder colorAny valid CSS <color>
border_styleBorder style"none", "solid", "dotted", "dashed", "inset", "outset", "ridge", "groove", "double"

DetailedSpacing

Used for specifying different spacing values for each side of an element (e.g. border_width, padding).

PropertyDescriptionType
topSpacing for the top sideNumber or String
leftSpacing for the left sideNumber or String
bottomSpacing for the bottom sideNumber or String
rightSpacing for the right sideNumber or String
padding: {
top: 10,
left: "5px",
bottom: 10,
right: "5px"
}

DetailedRadius

Used for specifying different border-radius values for each corner of an element (e.g. border_radius).

PropertyDescriptionType
top_leftRadius for the top-left cornerNumber or String
top_rightRadius for the top-right cornerNumber or String
bottom_leftRadius for the bottom-left cornerNumber or String
bottom_rightRadius for the bottom-right cornerNumber or String
border_radius: {
top_left: 5,
top_right: "10px",
bottom_left: 5,
bottom_right: "10px"
}

Open Markdown
Let us know what you think about this document :)