I have a page with several drop-down menus from several options. Each menu has a general category, for example:
Box1: Fruits Box2: Veggies
- Peach - Celery
- Orange - Broccoli
- Apple - Spinach
The page contains objects that contain up to one class from each drop-down list.
When a class is selected from the drop-down list, these objects are filtered based on the selected class, and only those that contain the class are displayed. For example, if you select βPeachβ from the first drop, all Apples and Oranges will be hidden. (.peach)
Since you can select multiple items from the drop-down list, you can also select Apple to display Apple and Peach objects, but not Oranges. (.peach, .apple)
In addition, you can select one of the veggies, and it will only display objects that contain both. (.peach.spinach)
The problem that I am facing is that I canβt figure out how to expand it so that I have something complicated, like βObjects that (Apples or peaches) AND (Spinach or Broccoli))β I admit what I could do (.apple.spinach, .apple.broccoli, .peach.spinach, .peach.broccoli), however it seems like it will be uselessly complicated, especially in that the size of the menu, the number of menus and the number of selected options (for example, I am simplified to two).
I tried several ways to solve this, for example:
(:has(.peach, .apple):has(.spinach, .broccoli))
([class~='apple', class~='peach'][class~='spinach', class~='broccoli'])
((.peach, .apple)(.spinach, .broccoli))
Is there any easy way to do this so that I am absent or squint? Or am I forced to create several heavy cycles to create all possible combinations of AND?