The Selectmenu Element Is No More…Long Live Select!

The Selectmenu Element Is No More…Long Live Select!


I was looking over an older article Patrick Brosset penned for us introducing , a new proposal at the time for a more style-able cousin to . I enjoyed looking at the boilerplate from Adam’s demo as a first glance:

select {
  &, &::picker(select) {
    appearance: base-select;
  }
  
  &::picker(select) {
    transition: 
      display allow-discrete 1s, 
      opacity 1s, 
      overlay 1s allow-discrete
    ;
  }
  
  &:not(:open)::picker(select) {
    opacity: 0;
  }
  
  &:open::picker(select) {
    opacity: 1;
    
    @starting-style {
      opacity: 0;
    }
  }
}

I see the ::picker(select) there that’s driving all of it. If I sneak a peek at Una’s post, I see that there are more ways to select different with additional CSS features for selecting the existing parts rather than moving forward with a completely new element. That’s cool, as one of Una’s demos shows how we still get the default