[CSS 3] :has()

Zhentiw發表於2024-06-24
ul li {
  border: 2px solid gray;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem;
}


// old way
ul li input:checked {
  accent-color: #f806e4;
}

// new way
ul li:has(input:checked) {
  border: 2px solid #f806e4;
}