Demo
Key takeaways
- Pick a theme for how your posts read, not for its demo images.
- Set your accent color and fonts in Settings › Design & branding before you touch any code.
- Add small extras, such as this box, with code injection, so a theme update doesn't remove them.
- Test the site on a phone before you send the first newsletter.
When to use it
- A long guide or report, for readers who decide from the summary whether to read the rest.
- A members-only post, above the Public preview divider, so free readers see what the full post covers.
- A news explainer or research write-up, where the conclusions matter more than how you got there.
When not to: For a one-line summary, the post's Excerpt field may be enough: many themes show it under the title.
The code
<section class="bt-key-takeaways">
<h2 class="bt-key-takeaways-title">Key takeaways</h2>
<ul class="bt-key-takeaways-list">
<li>Pick a theme for how your posts read, not for its demo images.</li>
<li>Set your accent color and fonts in <strong>Settings › Design & branding</strong> before you touch any code.</li>
<li>Add small extras, such as this box, with code injection, so a theme update doesn't remove them.</li>
<li>Test the site on a phone before you send the first newsletter.</li>
</ul>
</section>.bt-key-takeaways {
--bt-key-takeaways-accent: var(--ghost-accent-color, #4433ff);
--bt-key-takeaways-tint: 6%;
--bt-key-takeaways-radius: 6px;
box-sizing: border-box;
margin: 0 0 1.5em;
padding: 1.25em 1.5em;
border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
border-left: 4px solid var(--bt-key-takeaways-accent);
border-radius: var(--bt-key-takeaways-radius);
background-color: color-mix(in srgb, var(--bt-key-takeaways-accent) var(--bt-key-takeaways-tint), transparent);
color: inherit;
line-height: 1.6;
}
.bt-key-takeaways > .bt-key-takeaways-title {
margin: 0 0 0.5em;
padding: 0;
border: 0;
font-family: inherit;
font-size: 1em;
font-weight: 700;
line-height: 1.4;
letter-spacing: 0;
color: inherit;
}
.bt-key-takeaways > .bt-key-takeaways-list {
margin: 0;
padding: 0 0 0 1.25em;
list-style: disc;
}
.bt-key-takeaways > .bt-key-takeaways-list > li {
margin: 0.4em 0 0;
padding: 0 0 0 0.25em;
}
.bt-key-takeaways > .bt-key-takeaways-list > li::marker {
color: var(--bt-key-takeaways-accent);
}Add it to your site
- Copy the CSS and paste it in Settings › Advanced › Code injection › Site headerSettings › Advanced › Code injection › Site header (opens your Ghost Admin in a new tab), between
<style>and</style>. Once per site. - In a post, add an HTML card (type
/html) and paste the HTML. - Change the example text to your own, then publish or update the post.
Tip
Save the card as a Ghost snippet to add it to any post from the card menu: how Ghost snippets work.
How it works
The box is a <section> with its own heading and a plain list, so screen readers announce it as a heading followed by a list of four items, and readers who skim find it in the page outline. Change the heading to “In short” or “What you’ll learn” if that fits your posts better, and keep the list to three to five points: each one a full sentence a reader can act on without reading the rest.
The heading is an <h2>, which suits a box at the top of a post whose sections use <h2> too. The CSS sets its size, so changing the level doesn’t change the look. The text, the heading and the font come from your theme; only the border, the bullets and a light tint use the accent color, so the box works on light and dark themes.
To use it in every post without pasting it again, save the card as a Ghost snippet: see how to use Ghost snippets. The CSS from code injection doesn’t reach emails, so in a newsletter the box shows as a plain heading and list.
Customize
| Variable | Default | What it changes |
|---|---|---|
--bt-key-takeaways-accent | var(--ghost-accent-color, #4433ff) | The color of the left border, the list bullets and the background tint. Defaults to your site's accent color. |
--bt-key-takeaways-tint | 6% | How much of the accent color tints the background. 0% for no background. |
--bt-key-takeaways-radius | 6px | The corner radius. |