# Pros and cons for Ghost

HTML card + code injection · Works with any Ghost theme · No JavaScript

Source: https://brightthemes.com/snippets/pros-and-cons

Two lists side by side, with ticks and crosses, for reviews and comparisons; they stack on phones.

## When to use it
- A product or app review, as the verdict box just before your final recommendation.
- A post weighing two choices, such as two plans, two tools or two routes, before you say which you'd pick.
- A roundup of books, courses or gear, with a short pair of lists under each pick.
When not to: For one product with a star rating and a buy link, Ghost's **Product** card has both built in.

## The code

HTML:

```html
<div class="bt-pros-cons">
  <div class="bt-pros-cons-column bt-pros-cons-pros">
    <h3 class="bt-pros-cons-title">Pros</h3>
    <ul class="bt-pros-cons-list">
      <li>Wide, readable text column with a clear type scale</li>
      <li>Members, paid tiers and newsletters work out of the box</li>
      <li>Light and dark versions that follow the reader's setting</li>
    </ul>
  </div>
  <div class="bt-pros-cons-column bt-pros-cons-cons">
    <h3 class="bt-pros-cons-title">Cons</h3>
    <ul class="bt-pros-cons-list">
      <li>Two homepage layouts only</li>
      <li>Changing the fonts beyond Ghost's choices takes custom CSS</li>
    </ul>
  </div>
</div>
```

CSS:

```css
.bt-pros-cons {
  --bt-pros-cons-pro: #15803d;
  --bt-pros-cons-con: #dc2626;
  --bt-pros-cons-tint: 6%;
  --bt-pros-cons-radius: 6px;
  --bt-pros-cons-mark: var(--bt-pros-cons-pro);
  --bt-pros-cons-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.75l5 5L19.5 6.75'/%3E%3C/svg%3E");
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15em), 1fr));
  gap: 1em;
  margin: 0 0 1.5em;
  color: inherit;
  line-height: 1.5;
}

.bt-pros-cons > .bt-pros-cons-column {
  box-sizing: border-box;
  min-width: 0;
  padding: 1.25em;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-top: 4px solid var(--bt-pros-cons-mark);
  border-radius: var(--bt-pros-cons-radius);
  background-color: color-mix(in srgb, var(--bt-pros-cons-mark) var(--bt-pros-cons-tint), transparent);
}

.bt-pros-cons > .bt-pros-cons-cons {
  --bt-pros-cons-mark: var(--bt-pros-cons-con);
  --bt-pros-cons-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

.bt-pros-cons .bt-pros-cons-title {
  margin: 0 0 0.75em;
  padding: 0;
  border: 0;
  font-family: inherit;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  color: inherit;
}

.bt-pros-cons .bt-pros-cons-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-pros-cons .bt-pros-cons-list > li {
  position: relative;
  margin: 0.6em 0 0;
  padding: 0 0 0 1.6em;
}

.bt-pros-cons .bt-pros-cons-list > li:first-child {
  margin-top: 0;
}

.bt-pros-cons .bt-pros-cons-list > li::before {
  position: absolute;
  /* centred on the item's first line (its 1.5 line height), whatever the theme's font */
  top: calc(0.75em - 0.5em);
  left: 0;
  width: 1em;
  height: 1em;
  /* a drawn tick or cross (an SVG mask in the column's color), so both are the same size and sit the same way */
  background-color: var(--bt-pros-cons-mark);
  -webkit-mask: var(--bt-pros-cons-icon) center / contain no-repeat;
  mask: var(--bt-pros-cons-icon) center / contain no-repeat;
  content: '';
}
```

## Add it to your site

1. Copy the **CSS** and paste it in **Settings › Advanced › Code injection › Site header**, between `<style>` and `</style>`. Once per site.
2. In a post, add an **HTML card** (type `/html`) and paste the **HTML**.
3. 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, https://brightthemes.com/blog/ghost-snippets

## How it works

Each column is a heading and a plain list. The heading says which list it is, so a screen reader announces "Pros" or "Cons" before the items, and the ticks and crosses are drawn by the CSS as plain shapes, so they aren't read out a second time. Color is never the only signal: the heading and the mark tell the two lists apart too.

The columns sit side by side when each has at least 15em of room and stack on phones, without a media query, so they fit narrow theme layouts as well as wide ones. Add a third `bt-pros-cons-column` (for example "Good to know") and the grid makes room for it. The headings are `<h3>`, which suits a review whose sections use `<h2>`; change the level to fit your post, and the look stays the same. The text and font come from your theme, so the columns work on light and dark themes.

The marks use green and red rather than your accent color, since a tick in your brand color reads as neither good nor bad. Set `--bt-pros-cons-pro` and `--bt-pros-cons-con` to change them. To reuse the card in every review, save it as a Ghost snippet: see [how to use Ghost snippets](https://brightthemes.com/blog/ghost-snippets). The CSS from code injection doesn't reach emails, so in a newsletter the lists show plain, with their headings.

## Customize
| Variable | Default | What it changes |
|---|---|---|
| `--bt-pros-cons-pro` | `#15803d` | The color of the Pros column: its top border, tint and ticks. |
| `--bt-pros-cons-con` | `#dc2626` | The color of the Cons column: its top border, tint and crosses. |
| `--bt-pros-cons-tint` | `6%` | How much of each column's color tints its background. 0% for no background. |
| `--bt-pros-cons-radius` | `6px` | The corner radius. |

It works with every Ghost theme, including ours (https://brightthemes.com/themes). Something not right? Ask support: https://brightthemes.com/support
