Filtering the guide
We could very easily use JavaScript for filtering the guide, and there would be nothing wrong with doing that.
However, we can use :has()
now as well!
.mushroom-guide:has(#season [value="spring"]:checked)
.card:not(:has([data-season="spring"])) {
display: none;
}
This works, and would work for both of our filters.
However:
- It's complex and hard to read/understand
- Limited animation possibilities, which we'll be exploring later on
- Limited options when there is no matching results