Andrew Mayer
likeafunnername.bsky.social
Andrew Mayer
@likeafunnername.bsky.social
A developer that wants to know why and loves learning things.
I recently had a co-worker tell me that when styling a DOM element based on some state, we should utilize `data-*` attributes rather than toggling a CSS class. They argued that there were inherent performance benefits to targeting a dynamic `data-*` attribute with a CSS rule over CSS classes.
December 2, 2024 at 2:11 AM