Skip to content

Helper classes reference

Marketers Delight compiles a set of utility classes into its stylesheet. They are available in any block, template, or custom HTML on your site. All spacing values use the MD spacer scale, so they stay proportional to your typography settings.

Text

ClassEffect
.underlinetext-decoration: underline
.no-underlinetext-decoration: none (also on child a elements)
.normalSets the body font weight
.boldSets --md-bold font weight
.italicfont-style: italic
.footItalic, muted color, and small size
.body-fontApplies the body font family
.h-fontApplies the headline (h1) font family
.text-leftLeft-align text
.text-rightRight-align text
.text-centerCenter text
.lh1line-height: 1
.capstext-transform: uppercase
.smooth-scrollApplied to html to enable smooth scrolling (respects prefers-reduced-motion)
.font-sizeResets to body font size and line height
.small0.9em size, 1.5em line height
.tiny--md-font-size-tiny with matching line height
.introh6 font size and line height
.has-muted-colorMuted text color; muted link color on child links
.middotAdds a centered dot before the element (not on the first child)
.highlightHighlight background color with inline padding
.noteRounded box with subtle shadow
.alertYellow rounded box with subtle shadow
.badgeWarning-color pill badge
.avatarCircular image with a light shadow

Borders and radius

ClassEffect
.radiusborder-radius: --md-border-radius
.circleborder-radius: 50%
.border1px solid border on all sides
.border-tb1px solid border on top and bottom
.border-bottom1px solid border on the bottom only

Shadows

ClassEffect
.shadowDefault box shadow
.shadow-smallSmall box shadow
.shadow-mediumMedium box shadow
.shadow-largeLarge box shadow
.shadow-hugeHuge box shadow
.shadow-noneRemoves box shadow
.shadow-growTransitions to medium shadow on hover

Icon shapes

Use .circle-icon or .square-icon to size and center an icon. The default size is --md-single.

ModifierSize
(none)--md-single
.mid--md-mid + --md-small
.double--md-double
.triple--md-triple

Layout (flex)

ClassEffect
.flFlex row, vertically centered, --md-half gap
.stackFlex column, --md-single gap between children
.automargin-inline: auto (center in block context)
.growflex: 1
.full-basisflex-basis: 100%
.shrinkflex-shrink: 0
.relativeposition: relative
.absoluteposition: absolute
.reverseflex-direction: row-reverse
.columnflex-direction: column
.wrapflex-wrap: wrap
.justify-startjustify-content: flex-start
.justify-centerjustify-content: center
.justify-endjustify-content: flex-end
.justify-betweenjustify-content: space-between
.items-startalign-items: flex-start
.items-centeralign-items: center
.items-endalign-items: flex-end
.items-stretchalign-items: stretch
.self-centeralign-self: center

These mobile-only variants apply at 900px and below: .column-mobile, .reverse-mobile, .wrap-mobile, .justify-center-mobile, .items-center-mobile, .items-stretch-mobile, .width-full-mobile, .text-center-mobile.

Widths

ClassEffect
.content-widthmax-width: --md-width-content
.post-widthmax-width: --md-width-post
.wide-widthmax-width: --md-width-alignwide
.sidebar-widthmax-width: --md-width-sidebar
.width-fullwidth: 100%

Columns (grid)

ClassColumns at desktop
.columns1 column (base)
.columns-22 columns
.columns-33 columns (2 at 600–800px)
.columns-44 columns (2 at 600–800px)
.columns-55 columns (2 at 600–800px)
.columns-66 columns (2 at 600–800px)
.columns-fluid-2 through .columns-fluid-6Auto-fit grid: minimum column width is calculated so the specified number fills the row
.col-fullSpans all columns (grid-column: 1 / -1)

Columns and stacks accept .gap-{size} to override the gap. Available sizes: small, third, half, single, mid, double, triple, quad, none.

Spacing

Margin and padding classes use the spacer scale. Sizes: small, third, half, single, mid, double, triple, quad.

PatternEffect
.mt-{size}margin-block-start (skipped on the first child)
.mb-{size}margin-block-end
.mb-noneRemoves bottom margin
.mr-{size}margin-inline-end (available for half, third, small)
.ml-{size}margin-inline-start (available for half, third, small)
.block-{size}Padding on all sides
.block-{size}-tbPadding top and bottom
.block-{size}-lrPadding left and right (fluid for single and larger)
.block-{size}-topPadding top only
.block-{size}-botPadding bottom only
.block-{size}-xFluid padding on all sides (available for single, mid, double, triple, quad)
.pb-noneRemoves bottom padding
.break-{size}Negative bottom margin to pull the next element up by {size}

Mobile scroll container

.scroll-mobile — at 800px and below, converts a grid into a horizontal scroll container. Each child snaps to the start edge. Configure column width with --md-scroll-column and gap with --md-scroll-gap.

Editor colors

For each palette color (and any colors you add), three classes are generated:

PatternEffect
.has-{key}-colorText color
.has-{key}-background-colorBackground color
.has-{key}-border-colorBorder color

The key is the palette color's key (for example primary, surface, or a key you set when adding a color).

Animations

ClassEffect
.animate-fadeFades in
.animate-slide-upSlides up and fades in
.animate-slide-downSlides down and fades in
.animate-zoomScales up and fades in

All animations respect prefers-reduced-motion. Duration is --md-transition-slow (0.5s).

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.