CSS

Custom stylesheet

Create style.css in your project root. moss loads it after the default theme, so your rules override the defaults.

:root {
  --moss-color-accent: #2d5a2d;
  --moss-font-body: "Inter", -apple-system, sans-serif;
  --moss-content-width: 72ch;
}

No build step, no config entry. The file is loaded automatically.

Variables

Typography

VariableDefaultDescription
--moss-font-bodysystem sans-serif stackBody text font
--moss-font-headinginherits bodyHeading font
--moss-font-monoui-monospace, SFMono-RegularCode font
--moss-font-serifIowan Old Style, serif stackSerif font (used with font toggle)
--moss-font-size-base1.125remBase font size
--moss-font-weight320Default font weight

Colors

VariableDefaultDescription
--moss-color-accent#2d5a2dLinks, highlights, accent elements
--moss-color-bg#faf8f5Page background
--moss-color-text#2c2825Primary text
--moss-color-muted#8a8580Secondary/muted text
--moss-color-surface#f4f1ecCard and surface background

Layout

VariableDefaultDescription
--moss-content-width67chMaximum content width
--moss-content-width-sidebar62chContent width when sidebar is active
--moss-nav-widthvar(--moss-content-width)Navigation and footer max-width
--moss-sidebar-width280pxSidebar width
--moss-site-max-width1200pxMaximum overall site width
--moss-container-paddingclamp(1rem, 5vw, 2rem)Container side padding

Spacing

VariableDefaultDescription
--moss-space-xs0.5remExtra small (8px)
--moss-space-sm1remSmall (16px)
--moss-space-md1.5remMedium (24px)
--moss-space-lg2remLarge (32px)
--moss-space-xl3remExtra large (48px)
--moss-space-2xl4remDouble extra large (64px)

Dark mode

Dark mode follows the system preference automatically. Target the dark mode selector to customize:

[data-theme="dark"] {
  --moss-color-bg: #0f0f0f;
  --moss-color-accent: #6abf6a;
}

Component classes

Auto-generated components use stable .moss-* class names. Target these in your style.css.

Collection grid

ClassElement
.moss-collection-gridGrid container
.moss-collection-cardIndividual card
.moss-collection-card-coverCover image wrapper
.moss-collection-card-contentContent section below cover
.moss-collection-card-titleCard title
.moss-collection-card-countArticle count / subtitle

Child summary

ClassElement
.moss-child-summarySummary card
.moss-child-summary-rowFlex row (body + cover)
.moss-child-summary-bodyText content area
.moss-child-summary-metaDate or count
.moss-child-summary-titleTitle
.moss-child-summary-descriptionDescription excerpt
.moss-child-summary-coverSide cover image

Article list

ClassElement
.moss-article-listingListing container
.moss-article-itemIndividual list item
.moss-prefix-linkLink with prefix (date/count)
.moss-year-groupYear section heading

Shortcode classes

Add custom classes to shortcode blocks with {.class} syntax:

:::grid 3 {.profiles .featured}
...
:::

Then target them in CSS:

.profiles .moss-grid-card {
  border-radius: 50%;
}
Published with moss