Skip to content

CSS variables reference

Marketers Delight declares all of its design tokens as CSS custom properties on :root. Every --md-* variable is set during compilation and reflects the values you entered in the Edit Theme screen. You can read them in a child theme stylesheet or override them in a scoped selector.

Typography

VariableWhat it holds
--md-font-sizeBody font size, fluid between desktop and mobile values
--md-font-size-smallBody font size at mobile breakpoint (the Small token)
--md-font-size-tinyBody font size minus 2px (the Tiny token)
--md-font-size-introIntro text size: body × 1.2, fluid
--md-line-heightBody line height, fluid
--md-line-height-smallBody line height at mobile breakpoint
--md-line-height-tinyBody line height minus 1px
--md-boldThe bold font weight set on the Typography screen

Headings

Each level has a size variable and a line-height companion.

VariableWhat it holds
--md-hugeDisplay / huge size, fluid
--md-huge-line-heightDisplay line height, fluid
--md-h1 through --md-h6Heading sizes, each fluid
--md-h1-line-height through --md-h6-line-heightHeading line heights, each fluid

Spacing

All spacers derive from the body line height. Desktop values are fixed pixels; the -x variants are fluid, scaling toward --md-half at a 600px viewport.

VariableDerived from
--md-smallLine height ÷ 6
--md-thirdLine height ÷ 3
--md-halfLine height ÷ 2
--md-singleOne line height
--md-mid1.5× line height
--md-double2× line height
--md-triple3× line height
--md-quad4× line height
--md-single-xFluid --md-single
--md-mid-xFluid --md-mid
--md-double-xFluid --md-double
--md-triple-xFluid --md-triple
--md-quad-xFluid --md-quad

Widths

VariableWhat it holds
--md-width-siteMaximum site container width
--md-width-contentMain content column width
--md-width-alignwideWide-aligned block breakout width
--md-width-postPost text column width
--md-width-sidebarSidebar width
--md-width-panelPanel width
--md-width-site-wideFull-bleed container width

Effects

VariableWhat it holds
--md-border-radiusRounded corner radius
--md-box-shadowDefault box shadow
--md-box-shadow-smallSmall shadow
--md-box-shadow-mediumMedium shadow
--md-box-shadow-largeLarge shadow
--md-box-shadow-hugeHuge shadow
--md-transitionStandard transition duration (0.3s)
--md-transition-slowSlow transition duration (0.5s)

Palette colors

Set in Design → Color Palette.

VariablePalette color
--md-color-backgroundBackground
--md-color-surfaceSurface
--md-color-primaryPrimary
--md-color-secondarySecondary
--md-color-tertiaryTertiary
--md-color-dividerDivider
--md-color-highlightHighlight
--md-color-textText Main
--md-color-text-secondaryText Secondary
--md-color-warningWarning status color
--md-color-dangerDanger status color
--md-color-whiteWhite

Site-level resolved colors

Set individually in Design → Site Colors (or inherited from the palette).

VariableWhat it holds
--md-site-backgroundSite background color
--md-site-textSite text color
--md-site-text-mutedMuted text color
--md-site-text-contrastText that contrasts with the background
--md-site-linksSite link color
--md-site-links-mutedMuted link color
--md-site-headlinesHeadline color
--md-site-headline-linksLinked headline color

Semantic context variables

These aliases point to the current context's resolved colors. Inside a box-style section they switch to box values; inside the header they switch to header values. Override them in a scoped selector to re-theme a component.

VariableDefault alias
--md-text--md-site-text
--md-text-muted--md-site-text-muted
--md-links--md-site-links
--md-links-muted--md-site-links-muted
--md-headlines--md-site-headlines
--md-headline-links--md-site-headline-links
--md-border--md-content-border

Actions

VariableWhat it holds
--md-action-primaryPrimary button background
--md-action-primary-textPrimary button text
--md-action-secondarySecondary button background
--md-action-secondary-textSecondary button text
VariableWhat it holds
--md-header-backgroundHeader background
--md-header-textHeader text
--md-header-borderHeader border
--md-header-menu-linksNavigation link color
--md-header-menu-hoverNavigation link hover color
--md-header-menu-activeActive navigation link color
--md-header-submenu-backgroundSub-menu background
--md-header-submenu-linksSub-menu link color
--md-header-submenu-hoverSub-menu link hover color
--md-header-submenu-borderSub-menu border

Content area

VariableWhat it holds
--md-content-main-backgroundMain content background
--md-content-box-backgroundBox-style content background
--md-content-box-borderBox-style content border
--md-content-box-textBox-style content text
--md-content-box-text-mutedBox-style muted text
--md-content-box-linksBox-style link color
--md-content-borderContent border color
--md-page-cover-overlayPage cover overlay color
--md-form-backgroundForm input background (always #fff)
--md-tag-backgroundTag background (--md-color-tertiary)
VariableWhat it holds
--md-sidebar-backgroundSidebar background
--md-sidebar-textSidebar text
--md-sidebar-linksSidebar link color
--md-sidebar-titleSidebar widget title color
--md-sidebar-title-linksSidebar widget title link color
--md-panel-backgroundPanel background
--md-panel-textPanel text
--md-panel-linksPanel link color
--md-panel-borderPanel border
--md-footer-backgroundFooter background
--md-footer-textFooter text
--md-footer-borderFooter border
--md-footer-linksFooter link color
--md-footer-titleFooter widget title color
--md-footer-title-linksFooter widget title link color

Alex Mangini

Hi, I'm Alex! I started writing about web design and blogging at 13 years old, which turned into client work, which led to building my own software. 15 years later I'm still at it, and Marketers Delight is the epitome of my philosophy for building on the web.