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”

This week in front end architecture

In a react/redux application:

  • add a checkbox
    in jsx

  • capture its state by setting its vDom state with { [name]: !this.state.checked }
    in a switch statement

  • unit tests are jest snapshot diffs
    in typescript

  • className="bootstrap" or className={style.injection}
    incompatible

Making simple things hard in the front end again.