Just discovered focus-within which let's you style the parent of a focused input.

  .field {
  background: #eee;
}
.field:focus-within {
  background: lightyellow;
}

Browser compatibility: caniuse#focus-within (doesn't work on IE and Edge)


769 1 16