Back to CSS Input Fields Date Picker Native Pure CSS
Share
HTML
<label class="if-date">
  <span class="if-date-label">Start date</span>
  <input type="date" name="start" />
</label>
CSS
.if-date {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 280px;
}

.if-date-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #b8b6d4;
  text-transform: uppercase;
}

.if-date input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: #1a1a22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f0eeff;
  font:
    500 14px/1 system-ui,
    sans-serif;
  outline: none;
  transition:
    border-color 0.2s,
    background 0.2s;
  color-scheme: dark;
}

.if-date input:focus {
  border-color: #06b6d4;
  background: #1f1f2a;
}

.if-date input::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(5) hue-rotate(150deg);
  cursor: pointer;
  opacity: 0.8;
}

.if-date input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}