28 CSS Input Fields04 / 28
Glass Frosted
Frosted-glass input on a soft gradient. Translucent surface with `backdrop-filter` blur and an inner highlight — an elegant fit for hero sections.
Published
The code
<div class="if-04">
<div class="if-04-bg" aria-hidden="true"></div>
<label class="if-04-field">
<span>Search</span>
<input type="search" name="q" placeholder="Search anything…" />
</label>
</div><div class="if-04">
<div class="if-04-bg" aria-hidden="true"></div>
<label class="if-04-field">
<span>Search</span>
<input type="search" name="q" placeholder="Search anything…" />
</label>
</div>.if-04 {
position: relative;
width: 100%;
max-width: 280px;
border-radius: 14px;
padding: 14px;
isolation: isolate;
overflow: hidden;
}
.if-04-bg {
position: absolute;
inset: 0;
z-index: -1;
background: radial-gradient(40% 60% at 30% 30%, #f59e0b 0%, transparent 60%), radial-gradient(50% 60% at 80% 70%, #7c3aed 0%, transparent 60%), #0a0a14;
filter: blur(24px);
transform: scale(1.2);
}
.if-04-field {
display: grid;
gap: 6px;
font-size: 11px;
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
letter-spacing: 0.1em;
}
.if-04-field input {
width: 100%;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px) saturate(160%);
-webkit-backdrop-filter: blur(20px) saturate(160%);
border-radius: 10px;
padding: 10px 12px;
color: #fff;
font-size: 14px;
text-transform: none;
letter-spacing: 0;
outline: none;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
transition: border-color 0.2s, background 0.2s;
}
.if-04-field input::placeholder {
color: rgba(255, 255, 255, 0.45);
}
.if-04-field input:focus {
border-color: rgba(255, 255, 255, 0.5);
background: rgba(255, 255, 255, 0.16);
}.if-04 {
position: relative;
width: 100%;
max-width: 280px;
border-radius: 14px;
padding: 14px;
isolation: isolate;
overflow: hidden;
}
.if-04-bg {
position: absolute;
inset: 0;
z-index: -1;
background: radial-gradient(40% 60% at 30% 30%, #f59e0b 0%, transparent 60%), radial-gradient(50% 60% at 80% 70%, #7c3aed 0%, transparent 60%), #0a0a14;
filter: blur(24px);
transform: scale(1.2);
}
.if-04-field {
display: grid;
gap: 6px;
font-size: 11px;
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
letter-spacing: 0.1em;
}
.if-04-field input {
width: 100%;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px) saturate(160%);
-webkit-backdrop-filter: blur(20px) saturate(160%);
border-radius: 10px;
padding: 10px 12px;
color: #fff;
font-size: 14px;
text-transform: none;
letter-spacing: 0;
outline: none;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
transition: border-color 0.2s, background 0.2s;
}
.if-04-field input::placeholder {
color: rgba(255, 255, 255, 0.45);
}
.if-04-field input:focus {
border-color: rgba(255, 255, 255, 0.5);
background: rgba(255, 255, 255, 0.16);
}Here's a working CSS Input Field from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Glass Frosted
Source: https://codefronts.com/components/css-input-fields/glass-frosted/
Frosted-glass input on a soft gradient. Translucent surface with `backdrop-filter` blur and an inner highlight — an elegant fit for hero sections.
## HTML
```html
<div class="if-04">
<div class="if-04-bg" aria-hidden="true"></div>
<label class="if-04-field">
<span>Search</span>
<input type="search" name="q" placeholder="Search anything…" />
</label>
</div>
```
## CSS
```css
.if-04 {
position: relative;
width: 100%;
max-width: 280px;
border-radius: 14px;
padding: 14px;
isolation: isolate;
overflow: hidden;
}
.if-04-bg {
position: absolute;
inset: 0;
z-index: -1;
background: radial-gradient(40% 60% at 30% 30%, #f59e0b 0%, transparent 60%), radial-gradient(50% 60% at 80% 70%, #7c3aed 0%, transparent 60%), #0a0a14;
filter: blur(24px);
transform: scale(1.2);
}
.if-04-field {
display: grid;
gap: 6px;
font-size: 11px;
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
letter-spacing: 0.1em;
}
.if-04-field input {
width: 100%;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px) saturate(160%);
-webkit-backdrop-filter: blur(20px) saturate(160%);
border-radius: 10px;
padding: 10px 12px;
color: #fff;
font-size: 14px;
text-transform: none;
letter-spacing: 0;
outline: none;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
transition: border-color 0.2s, background 0.2s;
}
.if-04-field input::placeholder {
color: rgba(255, 255, 255, 0.45);
}
.if-04-field input:focus {
border-color: rgba(255, 255, 255, 0.5);
background: rgba(255, 255, 255, 0.16);
}
```Here's a working CSS Input Field from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Glass Frosted
Source: https://codefronts.com/components/css-input-fields/glass-frosted/
Frosted-glass input on a soft gradient. Translucent surface with `backdrop-filter` blur and an inner highlight — an elegant fit for hero sections.
## HTML
```html
<div class="if-04">
<div class="if-04-bg" aria-hidden="true"></div>
<label class="if-04-field">
<span>Search</span>
<input type="search" name="q" placeholder="Search anything…" />
</label>
</div>
```
## CSS
```css
.if-04 {
position: relative;
width: 100%;
max-width: 280px;
border-radius: 14px;
padding: 14px;
isolation: isolate;
overflow: hidden;
}
.if-04-bg {
position: absolute;
inset: 0;
z-index: -1;
background: radial-gradient(40% 60% at 30% 30%, #f59e0b 0%, transparent 60%), radial-gradient(50% 60% at 80% 70%, #7c3aed 0%, transparent 60%), #0a0a14;
filter: blur(24px);
transform: scale(1.2);
}
.if-04-field {
display: grid;
gap: 6px;
font-size: 11px;
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
letter-spacing: 0.1em;
}
.if-04-field input {
width: 100%;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px) saturate(160%);
-webkit-backdrop-filter: blur(20px) saturate(160%);
border-radius: 10px;
padding: 10px 12px;
color: #fff;
font-size: 14px;
text-transform: none;
letter-spacing: 0;
outline: none;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
transition: border-color 0.2s, background 0.2s;
}
.if-04-field input::placeholder {
color: rgba(255, 255, 255, 0.45);
}
.if-04-field input:focus {
border-color: rgba(255, 255, 255, 0.5);
background: rgba(255, 255, 255, 0.16);
}
```How this works
A frosted-glass input floating over a soft radial-gradient backdrop. The gradient lives on a dedicated .if-04-bg element behind the field, blurred with a 24px filter and scaled up 1.2x so the blur's soft edges never reveal the container's box.
The input itself uses backdrop-filter: blur(20px) saturate(160%) (with the -webkit- prefix for Safari) to sample and blur whatever sits behind it, plus a translucent white fill and an inset top highlight that mimics a glass bevel. Critically, the outer wrapper carries isolation: isolate, which creates a new stacking context so z-index: -1 on the backdrop layer stays trapped inside the component instead of leaking behind the page.
Make it yours
- Swap the two
radial-gradientcolour stops (#f59e0band#7c3aed) for any brand pair — high-saturation colours produce the strongest frost effect. - Tune the frost by adjusting
blur(20px)andsaturate(160%); higher saturation compensates for the desaturation that heavy blur naturally causes. - Deepen the glass fill by raising
rgba(255, 255, 255, 0.1)to0.16; keep the focus fill proportionally higher so the state change stays visible. - Round the corners uniformly by matching
border-radius: 14pxon the wrapper with10pxon the input, or set both equal for a chunkier look.
Gotchas — read before shipping
backdrop-filteronly samples pixels rendered behind it — remove the.if-04-bglayer or forgetisolation: isolateon the wrapper and the frost samples the page body instead.- Firefox shipped
backdrop-filterwithout a prefix in 103; older Firefox versions render a plain translucent fill with no blur, which still looks acceptable. - Nested
backdrop-filterinside a parent withoverflow: hiddenplusborder-radiuscan trigger flicker on Safari during scroll — test on iOS before shipping.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 76+ | 14+ | 103+ | 76+ |
backdrop-filter needs the -webkit- prefix for Safari; older Firefox falls back to a flat translucent fill without breaking layout.