Great tip here from Jhey. He advises using a
:root parent of the button when in “pressed” state and sets a root-level custom property to “on”.
Léonie tackles the prickly subject of “element re-purposing” in web development. This post follows a fantastic Twitter exchange started by Lea Verou regarding whether the common visual design request for “adjacent but mututally exclusive buttons” should be built as radio buttons or using
Using one element or set of elements (usually because of their functionality) and styling them to look like something else is a common pattern […but…] it creates a mismatch between the actions people expect they can take and the ones they actually can.
Modern CSS Solutions for Old CSS Problems
You have a “card” component which includes a heading, some text, an image, and a link to the full article, and it’s working great. Then along comes a UX requirement that the full card (not just the button or link) should be clickable. This is where things get complicated.
For many years I’ve been applying
cursor: pointer to buttons because it felt right and would improve the user experience.
See all tags.