28 CSS Input Field Designs

Liquid Border

Animated stroke that draws around the field on focus. A small flourish that makes a single text input feel deliberate and premium.

Pure CSS MIT licensed

Liquid Border the 6th of 28 designs in the 28 CSS Input Field Designs collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<label class="if-liquid">
  <span class="if-liquid-label">Project name</span>
  <input type="text" name="project" placeholder="My next big idea…" required />
</label>
.if-liquid {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 280px;
  font-size: 11px;
  color: #b8b6d4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.if-liquid input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  background: #1a1a22;
  border: 1px solid #2a2a36;
  border-radius: 8px;
  color: #f0eeff;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  outline: none;
  background-image:
    linear-gradient(90deg, #fbbf24, #fbbf24), linear-gradient(0deg, #fbbf24, #fbbf24),
    linear-gradient(90deg, #fbbf24, #fbbf24), linear-gradient(0deg, #fbbf24, #fbbf24);
  background-repeat: no-repeat;
  background-size:
    0 2px,
    2px 0,
    0 2px,
    2px 0;
  background-position:
    0 0,
    100% 0,
    100% 100%,
    0 100%;
  transition:
    background-size 0.35s linear,
    border-color 0.2s;
}

.if-liquid input::placeholder {
  color: #b8b6d4;
}

.if-liquid input:focus {
  border-color: transparent;
  background-size:
    100% 2px,
    2px 100%,
    100% 2px,
    2px 100%;
  transition-delay: 0s, 0.35s, 0.7s, 1.05s;
  transition-duration: 0.35s;
}

Search CodeFronts

Loading…