StartFoundationsComponentsContent

Prose

Prose styles a block of authored content, such as markdown or CMS output, without a class on every element. Use the .tk-prose class or the tk-prose element.

Stable Figma
OverviewUsageAPIAccessibility

Getting paid

Payouts arrive within two business days. See payout settings.

  • Bank transfer
  • Card, with a 1% fee
<div class="tk-prose">
  <h3>Getting paid</h3>
  <p>Payouts arrive within <strong>two business days</strong>. See <a href="/payouts">payout settings</a>.</p>
  <ul>
    <li>Bank transfer</li>
    <li>Card, with a 1% fee</li>
  </ul>
</div>

Class or element

Shipping

Orders over $50 ship free. Use FREESHIP at checkout.

<tk-prose>
  <h3>Shipping</h3>
  <p>Orders over $50 ship free. Use <code>FREESHIP</code> at checkout.</p>
</tk-prose>
  • .tk-prose class: for content in the page's own DOM, such as markdown output. The library adds the stylesheet to the page, so the class works as soon as thykes.js loads.
  • <tk-prose> element: when page styles must not reach the content, and Prose styles must not leak out. On mount it moves its children into its shadow root, so author the content once; don't re-render into it from a framework afterwards.

Both look the same; they use one set of rules.

What it styles

Element Style
h1 Title Large (32/40, 600)
h2 Title Medium (28/32, 600)
h3 Title Small (24/28, 600)
h4 Heading Medium (20/24, 600)
h5 Heading Small (18/24, 600)
h6 16/24, 600
p Body Medium (16/24, 400)
ul / ol disc, then circle, then square as lists nest; decimal for ol
blockquote a 4px leading border and secondary text
code mono on a subtle chip with a hairline border
kbd the same chip without the border
mark a warning-colored highlight
a the Link look: accent color and underline
strong / em semibold / italic
hr, small, del, sub, sup a hairline rule, small print, strikethrough, sub- and superscript
  • Headings get more space above than below, and margins between blocks collapse.
  • The block adds no outer space: the first child's top margin and the last child's bottom margin are removed. Space around it is yours.
  • code and kbd differ only by the hairline. If you restyle one, keep them apart.
  • Images, figures, and description lists (dl) aren't styled yet.

Code and tables

npm install thykes
PlanPrice
Starter$0
<div class="tk-prose">
  <pre><code>npm install thykes</code></pre>
  <table>
    <tr><th>Plan</th><th>Price</th></tr>
    <tr><td>Starter</td><td>$0</td></tr>
  </table>
</div>
  • pre gets mono type, a subtle surface, and horizontal scrolling. For syntax highlighting, line numbers, or copying, use Code block.
  • table gets borders, a semibold header row, and horizontal scrolling. For sorting or a sticky header, use Table.

Inline marks outside prose

Set --font-family-mono, press Esc, and the matching row highlights.

<p>Set <code class="tk-code">--font-family-mono</code>, press <kbd class="tk-kbd">Esc</kbd>, and the <mark class="tk-mark">matching row</mark> highlights.</p>

.tk-code, .tk-kbd, and .tk-mark give a lone snippet, key, or highlight the Prose look anywhere on the page.

  • Put the class on the real element: <code>, <kbd>, <mark>. The class only styles.
  • They match the Prose chips exactly and are easy to override.
  • For a shortcut with several keys, use Kbd. It names symbol keys for screen readers and swaps ⌘ and Ctrl by platform.