Sandrina Pereira
Thank you! 😃
I think this a solution worthy of Solomon. In this case, the Gordian knot is the select element and its inevitable recreation in order to style it.
What if we instead deliver a native select by default and replace it with a more aesthetically pleasing one if possible? That’s where the “hybrid” select idea comes into action. It’s “hybrid” because it consists of two selects, showing the appropriate one at the right moment:
- A native select, visible and accessible by default
- A custom select, hidden until it’s safe to be interacted with a mouse
The implementation uses a genius combination of a hover media query and an adjacent sibling selector in CSS. It has been tested on a number of device/platform/browser combinations but more tests are welcome!
What I love about this solution is that it satisfies the stakeholders insisting on a custom component but doesn’t abandon all the built-in accessibility that you get from native form controls.
Thank you! 😃
This is clever, and seems obvious in hindsight: use an anonymous @layer for your CSS reset rules!
I’m not the only one who’s amazed by how much you can do with just a little CSS these days.
A fantastic explanation of the building blocks of SVG, illustrated—as always—with Josh’s interactive examples.
This is a really thoughtful look at the evolution of CSS and the ever-present need to balance power with learnability.
I should be using the lh and rlh units more enough—they’re supported across the board!
Why I’d like to see one or two more elements included in the new proposal for styling form controls.
Using the CSS trinity of feature queries, logical properties, and unset.
Let me hear your blocky talk.
The transcript of a talk.
CSS logical properties here, they just aren’t evenly distributed yet.