Skip to content
MagiCMS

Inline text

Syntax reference

Inline text is a lightweight markup that lets content editors style words in a text field without writing HTML.

  • [[primary:word]] — word colored with the primary daisyUI color
  • [[class:font-mono:word]] — word with Tailwind class font-mono
  • [[rotate:a|b|c]] — cycles through a, b, c across renders (e.g. rotating hero label)
  • LINE ONE || LINE TWO — forces a line break inside the same paragraph

Markdown shortcuts: **bold**, *italic*, ++underline++. No raw HTML.

Configuration

src/inline-text.config.json:

{
  "semanticClasses": { "primary": "...", "muted": "...", "bold": "font-bold" },
  "extraClasses": ["font-mono", "text-secondary"]
}

semanticClasses is the curated allowlist (used by BlockHeading and most blocks). extraClasses is the catch-all for any Tailwind class in case managers need flexibility.

Tailwind safelist

src/styles/inline-text-safelist.css (generated by npm run sync) declares @source inline("...") for every class referenced in inline-text.config.json. Without this, Tailwind 4's JIT purges inline classes and they render as plain text.

BlockHeading integration

BlockHeading.astro exposes a role taxonomy:

  • hero — hero section
  • page — page title
  • section — section heading
  • card — card heading

The htmlLines field takes a list of inline-text lines and renders them as a heading with formatInlineTextLines().

Vi bruker cookies for å forbedre din opplevelse.