# Highlighter pen checkbox

> On a ruled notebook page, checking the box sweeps a fluorescent highlighter stroke behind the sentence.

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

## Where to use it

This checkbox lives on a sheet of ruled notebook paper with a red margin line. Checking it draws the tick in pen and sweeps a fluorescent highlighter stroke behind the label, slightly slanted and with uneven ends, the way a real marker lands. Hovering lets the tip peek in. It suits study planners, reading lists, revision apps and note-taking tools.

The main color is the highlighter ink, from lime to pink or orange, and the secondary color the pen used for the box and tick. Keep labels to one line, since the stroke follows a single row of text.

## Code

### HTML

```html
<label class="uvq02-hil"><input type="checkbox"><span class="bx"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1"/></svg></span><span class="tx">Review chapter 4</span></label>
```

### CSS

```css
.uvq02-hil {
  --c1: #e6ff3d;
  --c2: #2b46c8;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq02-hil {
  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;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
  gap: .8em;
  padding: .95em 1.4em .95em 2.9em;
  border-radius: .3em;
  background: linear-gradient(90deg,transparent 2.1em,#f2a0a0 2.1em 2.2em,transparent 2.2em),repeating-linear-gradient(transparent 0 1.55em,#bcd4ee 1.55em 1.62em) 0 .72em,#fffdf6;
  color: #1f2a44;
  font-family: ui-serif,Georgia,"Times New Roman",serif;
  box-shadow: 0 .1em .2em rgba(0,0,0,.08),0 .9em 1.6em -1em rgba(0,0,0,.4);
}

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

.uvq02-hil .bx {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  border-radius: .22em;
  box-shadow: inset 0 0 0 2px var(--c2);
  color: var(--c2);
  transition: background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-hil .bx svg {
  width: .95em;
  height: .95em;
}

.uvq02-hil .bx path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-hil .tx {
  position: relative;
  isolation: isolate;
  font-size: 1.15em;
  font-style: italic;
  white-space: nowrap;
}

.uvq02-hil .tx::before {
  content: "";
  position: absolute;
  left: -.25em;
  right: -.3em;
  top: .18em;
  bottom: .02em;
  z-index: -1;
  background: var(--c1);
  opacity: .9;
  border-radius: .2em .6em .3em .7em/.5em .25em .6em .3em;
  transform: scaleX(0) skewX(-10deg);
  transform-origin: 0 50%;
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.7,0,.3,1);
}

.uvq02-hil:hover .tx::before {
  transform: scaleX(.08) skewX(-10deg);
}

.uvq02-hil:active .bx {
  transform: scale(.9);
}

.uvq02-hil input:checked + .bx {
  background: color-mix(in srgb,var(--c2) 12%,transparent);
}

.uvq02-hil input:checked + .bx path {
  stroke-dashoffset: 0;
}

.uvq02-hil input:checked ~ .tx::before {
  transform: scaleX(1) skewX(-10deg);
}

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

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

### React

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

const css = `
.uvq02-hil {
  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;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
  gap: .8em;
  padding: .95em 1.4em .95em 2.9em;
  border-radius: .3em;
  background: linear-gradient(90deg,transparent 2.1em,#f2a0a0 2.1em 2.2em,transparent 2.2em),repeating-linear-gradient(transparent 0 1.55em,#bcd4ee 1.55em 1.62em) 0 .72em,#fffdf6;
  color: #1f2a44;
  font-family: ui-serif,Georgia,"Times New Roman",serif;
  box-shadow: 0 .1em .2em rgba(0,0,0,.08),0 .9em 1.6em -1em rgba(0,0,0,.4);
}

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

.uvq02-hil .bx {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  border-radius: .22em;
  box-shadow: inset 0 0 0 2px var(--c2);
  color: var(--c2);
  transition: background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-hil .bx svg {
  width: .95em;
  height: .95em;
}

.uvq02-hil .bx path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-hil .tx {
  position: relative;
  isolation: isolate;
  font-size: 1.15em;
  font-style: italic;
  white-space: nowrap;
}

.uvq02-hil .tx::before {
  content: "";
  position: absolute;
  left: -.25em;
  right: -.3em;
  top: .18em;
  bottom: .02em;
  z-index: -1;
  background: var(--c1);
  opacity: .9;
  border-radius: .2em .6em .3em .7em/.5em .25em .6em .3em;
  transform: scaleX(0) skewX(-10deg);
  transform-origin: 0 50%;
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.7,0,.3,1);
}

.uvq02-hil:hover .tx::before {
  transform: scaleX(.08) skewX(-10deg);
}

.uvq02-hil:active .bx {
  transform: scale(.9);
}

.uvq02-hil input:checked + .bx {
  background: color-mix(in srgb,var(--c2) 12%,transparent);
}

.uvq02-hil input:checked + .bx path {
  stroke-dashoffset: 0;
}

.uvq02-hil input:checked ~ .tx::before {
  transform: scaleX(1) skewX(-10deg);
}

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

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

export default function ChkHighlighter() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e6ff3d",
          "--c2": "#2b46c8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-hil"><input type="checkbox" /><span className="bx"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" /></svg></span><span className="tx">Review chapter 4</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 “Highlighter pen checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
On a ruled notebook page, checking the box sweeps a fluorescent highlighter stroke behind the sentence.

## Chosen settings
- Main color: #e6ff3d
- Secondary color: #2b46c8
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Repasar el tema 4"

## 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-hil {
  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;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
  gap: .8em;
  padding: .95em 1.4em .95em 2.9em;
  border-radius: .3em;
  background: linear-gradient(90deg,transparent 2.1em,#f2a0a0 2.1em 2.2em,transparent 2.2em),repeating-linear-gradient(transparent 0 1.55em,#bcd4ee 1.55em 1.62em) 0 .72em,#fffdf6;
  color: #1f2a44;
  font-family: ui-serif,Georgia,"Times New Roman",serif;
  box-shadow: 0 .1em .2em rgba(0,0,0,.08),0 .9em 1.6em -1em rgba(0,0,0,.4);
}

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

.uvq02-hil .bx {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  border-radius: .22em;
  box-shadow: inset 0 0 0 2px var(--c2);
  color: var(--c2);
  transition: background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-hil .bx svg {
  width: .95em;
  height: .95em;
}

.uvq02-hil .bx path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-hil .tx {
  position: relative;
  isolation: isolate;
  font-size: 1.15em;
  font-style: italic;
  white-space: nowrap;
}

.uvq02-hil .tx::before {
  content: "";
  position: absolute;
  left: -.25em;
  right: -.3em;
  top: .18em;
  bottom: .02em;
  z-index: -1;
  background: var(--c1);
  opacity: .9;
  border-radius: .2em .6em .3em .7em/.5em .25em .6em .3em;
  transform: scaleX(0) skewX(-10deg);
  transform-origin: 0 50%;
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.7,0,.3,1);
}

.uvq02-hil:hover .tx::before {
  transform: scaleX(.08) skewX(-10deg);
}

.uvq02-hil:active .bx {
  transform: scale(.9);
}

.uvq02-hil input:checked + .bx {
  background: color-mix(in srgb,var(--c2) 12%,transparent);
}

.uvq02-hil input:checked + .bx path {
  stroke-dashoffset: 0;
}

.uvq02-hil input:checked ~ .tx::before {
  transform: scaleX(1) skewX(-10deg);
}

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

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

export default function ChkHighlighter() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e6ff3d",
          "--c2": "#2b46c8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-hil"><input type="checkbox" /><span className="bx"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" /></svg></span><span className="tx">Review chapter 4</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.
````
