Click triggers that don’t break after a redesign

Stop matching on CSS classes. Use data attributes, matches CSS selector and a fallback strategy your developers will thank you for.

Every redesign kills a few click triggers. It does not have to.

Why classes are fragile

Class names belong to designers and CSS frameworks; they change without notice.

Data attributes to the rescue

Ask for data-track attributes once and match them with “matches CSS selector”.

Leave a comment

Your email is never published. Links and code are welcome — spam is not.