← All elements

Recipe Ingredient Checklist Card

by @admin · 0 views

<article class="ric"><h3>Garlic Fried Rice</h3><label><input type="checkbox" checked><span>3 cups cooked rice</span></label><label><input type="checkbox"><span>6 cloves garlic</span></label><label><input type="checkbox"><span>2 tbsp oil</span></label><label><input type="checkbox"><span>Salt to taste</span></label><p></p></article>

About this card

A recipe card with a tickable ingredient list that strikes items through and counts them with CSS counters.

How it works

Each ingredient is a label with a checkbox and text. A checked box strikes the neighbouring text through and increments a CSS counter. The paragraph after the list prints that counter, so the total of gathered ingredients updates immediately without any script.

Ways to customise it

  • Change the ingredients and the total number in the final content rule.
  • Change #ca8a04 for the accent colour.
  • Swap the serif heading font.

Good to know

The counter text is generated content, so also confirm it reads well in the screen readers you target. Ticks are lost on reload unless you store them.

Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.

More in Cards

View all →