Decorator styles
The named styles each decorator uses, with their built-in defaults. Every theme has them, even one you build from scratch. To change one, define a style with the same name in config/quoin.php or with Theme::withStyle(). See Restyling for an example.
Colors are Tailwind palette names.
| Styles | Defaults |
|---|---|
card, card.title, card.body | 1pt slate-300 border, 4pt radius. A bold slate-100 title strip with 3pt corners. 10pt body padding. |
callout, callout.<tone>, callout.title, callout.title.<tone> | A 3pt rule on the left and a tinted box, in sky, emerald, amber or red for note, tip, warning and danger: the rule in -500, the box in -50. A bold title in -800. |
blockquote, blockquote.cite | A 3pt slate-300 rule on the left, italic slate-700. The cite at 0.9em in slate-500, upright. |
section, section.heading, section.number, section.title, section.rule, section.body | A 6pt gap. A bold title, a bold slate-500 number 18pt wide, a 0.75pt slate-200 rule. The heading is always a row. |
field, field.label, field.placeholder | 1pt slate-300 border, 3pt radius. A 0.9em slate-600 label. An italic slate-400 placeholder. |
choice, choice.option, choice.marker, choice.marker.radio, choice.marker.selected, choice.mark, choice.mark.radio, choice.label.selected | A 0.75em marker with a 1pt slate-400 border, round for radio. Selected: a slate-800 border, a 0.42em inner mark and a bold label. 6pt between marker and label. |
key-value, key-value.label, key-value.value | No borders. Labels in slate-600. |
pre, code | Monospace (the theme's mono family) at 0.9em on a slate-100 background. pre also keeps spaces, tabs and line breaks (white-space: pre-wrap), with 6pt 8pt padding and a 6pt bottom margin. code is inline, with no padding. |
code-block, code-block.code, code-block.label, code-block.bar | The box (<x-doc::pre language>): 0.5pt border, 3pt radius, 6pt 8pt padding, 6pt bottom margin. The code is monospace at 0.9em with pre-wrap. The label is 0.7em, semibold, right-aligned. The bar (strip only) has a bottom border. Colors are not built in: they come from the code theme, and only the block's own style (->background() in PHP, background="…" on the tag) overrides them. Named styles set geometry. To recolor every block, pick or write a theme. |
code-block.strip, code-block.code.strip, code-block.bar.strip, code-block.label.strip, code-block.caption, code-block.label.caption, code-block.code.caption | The strip and caption looks, applied after the plain name. strip moves the padding from the box to the code and puts the label on the left. caption drops the border, radius and padding of the box and gives the code a 2pt rule on the left; the block itself puts the label above the box, and code-block.label.caption only sets its alignment and margin. These are built in, unlike other variants. |
toc, toc.title, toc.entry, toc.level-1, toc.level-2, toc.level-3, toc.level-4 | The table of contents (not a decorator, but styled the same way). toc is the block, with a 12pt bottom margin. toc.title is 14pt bold with an 8pt bottom margin. toc.entry is every entry, with a 3pt bottom margin. toc.level-1 is bold with 6pt above. toc.level-2, -3 and -4 indent by 12pt, 24pt and 36pt. |
markup.table, markup.th, markup.td, markup.hr | The tables and rules in converted rich text. A table gets a 0.75pt slate-300 rule on its top and left, and each cell one on its right and bottom, so the grid has no doubled lines. A header cell (th) has a slate-50 background. A rule (hr) is a 0.75pt slate-300 line with 6pt above and below. |
badge, badge.<tone> | A bold pill at 0.9em, in slate, sky, emerald, amber or red for neutral, note, tip, warning and danger: the background in -100, the text in -800. Each tone also sets a -300 border color, which shows only when a border is drawn (the outline variant). |
stat, stat.label, stat.value, stat.note | A slate-50 panel with 6pt corners and 10pt 12pt padding. The label at 0.75em, bold slate-500; the value at 1.8em, bold slate-900; the note at 0.8em in slate-600. |
totals, totals.label, totals.value, totals.total-label, totals.total-value | The block is 45% wide, aligned to the end of its container, and doesn't shrink (shrink: 0), so beside a growing paragraph in a row the paragraph gives way. Labels in slate-600, values right-aligned, 2pt above and below each row and 12pt between the columns. Total rows add a bold slate-900 1.1em label and value, with a 1pt slate-300 rule above and 4pt over the text. |
signature, signature.line, signature.name, signature.role, signature.date | The block is 216pt (3in) wide and kept together. The line is at least 30pt high, with a 0.75pt slate-700 rule along its bottom and its content resting on the rule. The name is bold, 4pt below the line; the role and date are 0.85em in slate-600. |
field.line, badge.outline, card.flat, card.title.flat, section.large, section.title.large, section.number.large | The built-in variants. field.line keeps only a 1pt slate-400 bottom rule, with no radius and 2pt 0 padding. badge.outline has no fill and a 0.75pt border in the tone's color. card.flat drops the border for a slate-50 panel, and its title strip loses its rule. section.large sets the title and number at 1.35em, with an 8pt gap and 10pt below. |
Setting pre or code in your theme replaces the whole built-in style: a pre that sets only font-family loses white-space: pre-wrap, its padding and its background. To change the font, set mono_family instead. When you override pre, include white-space: pre-wrap.
How the names combine
A warning callout applies callout and then callout.warning, and its title applies callout.title and then callout.title.warning. Where they overlap, the later style wins. The base style sets the shape and the tone style sets the colors, so either can be replaced on its own.
Badges work the same way (badge, then badge.<tone>), and so do selected checkboxes (choice.marker, then choice.marker.selected).
Variants
With variant="large" (->variant('large') in PHP), every name above that a decorator applies is followed by the same name with .large added, such as section.title.large or callout.title.large, if your theme defines it. The order is the built-in name, the tone, the variant, then your own style="". Tone names (badge.<tone>, callout.<tone>, callout.title.<tone>) do not take variant suffixes: variants follow the tone-less part names. Apart from the code block's strip and caption and the four in the table above, variant styles are not built in. See Variants.