# Markdown task checkbox

> A code editor line where the empty brackets turn into [x] and the text gets wrapped in ~~ strikethrough marks.

- Category: [Checkboxes](https://library.aimran.es/components/checkboxes)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-chk-markdown
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Made for developers, this checkbox looks like a line in a dark code editor, with a line number, a Markdown list dash and square brackets. Checking it types an x between the brackets, adds the ~~ strikethrough markers around the text in two steps and greys the task out. A block cursor blinks on hover and focus. It suits changelogs, dev tools, documentation and README-style task lists.

The main color is the x and the cursor, the secondary color the brackets, like a syntax theme. Change the line number and font to match your editor, and stack several lines for a release checklist.

## Code

### HTML

```html
<label class="uvq02-md"><input type="checkbox"><span class="ln" aria-hidden="true">12</span><span class="cd"><span class="mk" aria-hidden="true">- [<span class="x"><i>x</i></span>]</span> <span class="st" aria-hidden="true">~~</span><span class="tx">Release version 2.0</span><span class="st" aria-hidden="true">~~</span></span></label>
```

### CSS

```css
.uvq02-md {
  --c1: #7ee787;
  --c2: #ffa657;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq02-md {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: .9em;
  padding: .85em 1.2em .85em .9em;
  border-radius: .6em;
  background: #16181d;
  color: #d8dee9;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: calc(var(--s) * .95);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07),0 1em 2em -1.2em rgba(0,0,0,.6);
}

.uvq02-md input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-md .ln {
  padding-right: .9em;
  border-right: 1px solid rgba(255,255,255,.1);
  color: #5c6370;
}

.uvq02-md .cd {
  white-space: nowrap;
}

.uvq02-md .mk {
  color: var(--c2);
}

.uvq02-md .x {
  display: inline-block;
  width: 1ch;
  text-align: center;
  border-radius: .15em;
  transition: background calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-md .x i {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  color: var(--c1);
  transform: scale(0);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-md .st {
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  color: #6b7280;
  transition: width calc(0.3s / var(--k)) steps(2);
}

.uvq02-md .tx {
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-md .cd::after {
  content: "";
  display: inline-block;
  width: .6ch;
  height: 1.15em;
  margin-left: .2ch;
  vertical-align: -.2em;
  background: var(--c1);
  opacity: 0;
}

.uvq02-md:hover .cd::after,.uvq02-md:has(input:focus-visible) .cd::after {
  animation: uvq02-md 1s steps(1) infinite;
}

.uvq02-md:hover .x,.uvq02-md:active .x {
  background: rgba(255,255,255,.1);
}

.uvq02-md input:checked ~ .cd .x i {
  transform: scale(1);
}

.uvq02-md input:checked ~ .cd .st {
  width: 2ch;
}

.uvq02-md input:checked ~ .cd .tx {
  color: #7d8590;
  text-decoration: line-through 1px;
}

@keyframes uvq02-md {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.uvq02-md:has(input:focus-visible) {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq02-md,.uvq02-md *,.uvq02-md *::before,.uvq02-md *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uvq02-md {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: .9em;
  padding: .85em 1.2em .85em .9em;
  border-radius: .6em;
  background: #16181d;
  color: #d8dee9;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: calc(var(--s) * .95);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07),0 1em 2em -1.2em rgba(0,0,0,.6);
}

.uvq02-md input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-md .ln {
  padding-right: .9em;
  border-right: 1px solid rgba(255,255,255,.1);
  color: #5c6370;
}

.uvq02-md .cd {
  white-space: nowrap;
}

.uvq02-md .mk {
  color: var(--c2);
}

.uvq02-md .x {
  display: inline-block;
  width: 1ch;
  text-align: center;
  border-radius: .15em;
  transition: background calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-md .x i {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  color: var(--c1);
  transform: scale(0);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-md .st {
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  color: #6b7280;
  transition: width calc(0.3s / var(--k)) steps(2);
}

.uvq02-md .tx {
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-md .cd::after {
  content: "";
  display: inline-block;
  width: .6ch;
  height: 1.15em;
  margin-left: .2ch;
  vertical-align: -.2em;
  background: var(--c1);
  opacity: 0;
}

.uvq02-md:hover .cd::after,.uvq02-md:has(input:focus-visible) .cd::after {
  animation: uvq02-md 1s steps(1) infinite;
}

.uvq02-md:hover .x,.uvq02-md:active .x {
  background: rgba(255,255,255,.1);
}

.uvq02-md input:checked ~ .cd .x i {
  transform: scale(1);
}

.uvq02-md input:checked ~ .cd .st {
  width: 2ch;
}

.uvq02-md input:checked ~ .cd .tx {
  color: #7d8590;
  text-decoration: line-through 1px;
}

@keyframes uvq02-md {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.uvq02-md:has(input:focus-visible) {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq02-md,.uvq02-md *,.uvq02-md *::before,.uvq02-md *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function ChkMarkdown() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#7ee787",
          "--c2": "#ffa657",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-md"><input type="checkbox" /><span className="ln" aria-hidden="true">12</span><span className="cd"><span className="mk" aria-hidden="true">- [<span className="x"><i>x</i></span>]</span> <span className="st" aria-hidden="true">~~</span><span className="tx">Release version 2.0</span><span className="st" aria-hidden="true">~~</span></span></label>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Markdown task checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
A code editor line where the empty brackets turn into [x] and the text gets wrapped in ~~ strikethrough marks.

## Chosen settings
- Main color: #7ee787
- Secondary color: #ffa657
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Publicar la versión 2.0"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import type { CSSProperties } from "react";

const css = `
.uvq02-md {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: .9em;
  padding: .85em 1.2em .85em .9em;
  border-radius: .6em;
  background: #16181d;
  color: #d8dee9;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: calc(var(--s) * .95);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07),0 1em 2em -1.2em rgba(0,0,0,.6);
}

.uvq02-md input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-md .ln {
  padding-right: .9em;
  border-right: 1px solid rgba(255,255,255,.1);
  color: #5c6370;
}

.uvq02-md .cd {
  white-space: nowrap;
}

.uvq02-md .mk {
  color: var(--c2);
}

.uvq02-md .x {
  display: inline-block;
  width: 1ch;
  text-align: center;
  border-radius: .15em;
  transition: background calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-md .x i {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  color: var(--c1);
  transform: scale(0);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-md .st {
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  color: #6b7280;
  transition: width calc(0.3s / var(--k)) steps(2);
}

.uvq02-md .tx {
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-md .cd::after {
  content: "";
  display: inline-block;
  width: .6ch;
  height: 1.15em;
  margin-left: .2ch;
  vertical-align: -.2em;
  background: var(--c1);
  opacity: 0;
}

.uvq02-md:hover .cd::after,.uvq02-md:has(input:focus-visible) .cd::after {
  animation: uvq02-md 1s steps(1) infinite;
}

.uvq02-md:hover .x,.uvq02-md:active .x {
  background: rgba(255,255,255,.1);
}

.uvq02-md input:checked ~ .cd .x i {
  transform: scale(1);
}

.uvq02-md input:checked ~ .cd .st {
  width: 2ch;
}

.uvq02-md input:checked ~ .cd .tx {
  color: #7d8590;
  text-decoration: line-through 1px;
}

@keyframes uvq02-md {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.uvq02-md:has(input:focus-visible) {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq02-md,.uvq02-md *,.uvq02-md *::before,.uvq02-md *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function ChkMarkdown() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#7ee787",
          "--c2": "#ffa657",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-md"><input type="checkbox" /><span className="ln" aria-hidden="true">12</span><span className="cd"><span className="mk" aria-hidden="true">- [<span className="x"><i>x</i></span>]</span> <span className="st" aria-hidden="true">~~</span><span className="tx">Release version 2.0</span><span className="st" aria-hidden="true">~~</span></span></label>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
