# Countdown drain (B 185)

Category: Buttons  
Tags: progress, pill, drain, animated, timed  
Page: https://designforai.dev/snippet/btn-185

## Prompt

An "Undo" pill that visually counts down: a yellow #fef08a fill behind the label shrinks from full width to zero over 5 seconds (scaleX from the left, forwards fill) as the window to act closes. White base, 1px #cbd5e1 border, #0f172a 14px semibold text, 11px by 24px padding. Hovering pauses the drain; active fills #fde047. Focus 2px dark outline.

## HTML

```html
<button class="btn-185">Undo</button>
```

## CSS

```css
.btn-185 {
  position: relative;
  font: 600 14px/1 system-ui,sans-serif;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 11px 24px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate
}
.btn-185::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #fef08a;
  z-index: -1;
  transform-origin: left;
  animation: drain185 5s linear forwards
}
.btn-185:hover::before {
  animation-play-state: paused
}
.btn-185:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 3px
}
.btn-185:active {
  background: #fde047
}
@keyframes drain185 {
  to {
    transform: scaleX(0)
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn-185, .btn-185 * { animation: none; transition: none; }
}
```
