Custom Attributes are Fast, Good, and Cheap

After years working with HTML and CSS, we have come to a surprising conclusion.

Avoid using CSS classes and className and classList when deriving styles based on some “state.” Instead, prefer HTML element attributes, and CSS attribute selectors.
— Me, this week, all the time

Continue reading “Custom Attributes are Fast, Good, and Cheap”

TIP: Set “type” attributes explicitly on <button> elements

File under “Tiny little HTML5 useful tip.”

TL;DR

Apply this habit to all buttons contained within a form. Buttons outside of forms are just
buttons, not form controls.

Continue reading “TIP: Set “type” attributes explicitly on <button> elements”