# To-Do Checklist

> A to-do list with round checkboxes where finished tasks get a line drawn through them and fade out.

- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: todo, task list, checkbox, strikethrough, done, checklist
- Live preview: https://copy-css.com/snippets/todo-checklist
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<fieldset class="todo-list">
  <legend>Today</legend>
  <label><input type="checkbox" checked><span>Review pull request</span></label>
  <label><input type="checkbox"><span>Write release notes</span></label>
  <label><input type="checkbox"><span>Book team lunch</span></label>
</fieldset>
```

## CSS

```css
.todo-list {
  display: grid;
  gap: 4px;
  width: 240px;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px -10px rgba(113, 63, 18, 0.35);
  color: #422006;
  font-family: system-ui, sans-serif;
}

.todo-list legend {
  float: left;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 800;
}

.todo-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
}

.todo-list input {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid #facc15;
  border-radius: 50%;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.todo-list input::before {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.todo-list input:checked {
  border-color: #ca8a04;
  background: #ca8a04;
}

.todo-list input:checked::before {
  transform: scale(1);
}

.todo-list input:focus-visible {
  outline: 2px solid #ca8a04;
  outline-offset: 2px;
}

.todo-list span {
  background: linear-gradient(#a16207, #a16207) no-repeat 0 55% / 0 1.5px;
  transition: background-size 0.3s ease, color 0.3s ease;
}

.todo-list input:checked + span {
  background-size: 100% 1.5px;
  color: #a8a29e;
}

@media (prefers-reduced-motion: reduce) {
  .todo-list span,
  .todo-list input::before {
    transition: none;
  }
}
```

## Notes

- This CSS To-Do Checklist is 83 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, linear gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
