Skip to main content

AML Theme

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 {
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
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

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.border_widthCanvas border widthNumber, String, or DetailedSpacing
border.border_radiusCanvas corner roundnessNumber, String, or DetailedRadius
border.border_colorCanvas border colorAny valid CSS <color>
border.border_styleCanvas border style"none", "solid", "dotted", "dashed", "inset", "outset", "ridge", "groove", "double"
background.bg_colorCanvas background colorAny valid CSS <color>
background.bg_imageCanvas background imageAny valid CSS <image>
background.bg_repeatHow the canvas background image repeatsfalse, true, "x", "y", "space", "round"
background.bg_sizeHow the canvas background image is sized"cover", "contain"
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_familyFont family for block titlesWeb-safe or custom fonts. Learn more e.g. "Inter", "Arial, sans-serif"
label.font_sizeFont size for block titlesAny valid CSS <length> e.g. 14, "14px", "2em"
label.font_colorFont color for block titlesAny valid CSS <color>
label.font_weightFont weight for block titles"light", "normal", "medium", "semibold", "bold", "extrabold"
label.font_styleFont style for block titles"normal", "italic"
label.letter_spacingLetter spacing for block titlesAny valid CSS letter-spacing e.g. 1, "0.05em"
label.text_decorationText decoration for block titles"underline", "overline", "line-through"
label.text_transformText transform for block titles"uppercase", "lowercase", "capitalize"
text.font_familyFont family for block text contentWeb-safe or custom fonts. Learn more
text.font_sizeFont size for block text contentAny valid CSS <length>
text.font_colorFont color for block text contentAny valid CSS <color>
text.font_weightFont weight for block text content"light", "normal", "medium", "semibold", "bold", "extrabold"
text.font_styleFont style for block text content"normal", "italic"
text.letter_spacingLetter spacing for block text contentAny valid CSS letter-spacing
text.text_decorationText decoration for block text content"underline", "overline", "line-through"
text.text_transformText transform for block text content"uppercase", "lowercase", "capitalize"
border.border_widthBlock border widthNumber, String, or DetailedSpacing
border.border_radiusBlock corner roundnessNumber, String, or DetailedRadius
border.border_colorBlock border colorAny valid CSS <color>
border.border_styleBlock border style"none", "solid", "dotted", "dashed", "inset", "outset", "ridge", "groove", "double"
background.bg_colorBlock background colorAny valid CSS <color>
background.bg_imageBlock background imageAny valid CSS <image>
background.bg_repeatHow the block background image repeatsfalse, true, "x", "y", "space", "round"
background.bg_sizeHow the block background image is sized"cover", "contain"
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).

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"

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

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

Dashboard my_dashboard {
block viz_block: VizBlock {
viz: PivotTable {
theme: VizTheme {
table {
general {
bg_color: 'white'
}
}
}
}
}
}

Helper types

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 :)