CSS Classes Considered Harmful
keithcirkel.co.uk
CSS Classes Considered Harmful
1–10 of 28 posts
Re: CSS Classes Considered Harmful
#2Modern devices are pretty fast though, so maybe it's not an issue - but I know in the past the cost of doing CSS rule evaluation has been a problem.
Re: CSS Classes Considered Harmful
#3Re: CSS Classes Considered Harmful
#4Re: CSS Classes Considered Harmful
#5Wish this article dedicated time to considering whether widespread use of attribute selectors will slow down the browser, but it doesn't seem to. CSS class selectors have been aggressively optimized by browser vendors for decades, vs. selectors that just filter on an arbitrary set of HTML attributes. Modern devices are pretty fast though, so maybe it's not an issue - but I know in the past the cost of doing CSS rule…
Re: CSS Classes Considered Harmful
#6Re: CSS Classes Considered Harmful
#7 some other CSS can come along
and co-opt what big means
Doesn't matter, because you would not style ".big" but ".card.big".Yes, if someone would redefine "card", that would be a problem. That's why this "base class" should not be as short as just "card" but rather "userInfoCard" or something like that.
Re: CSS Classes Considered Harmful
#8Re: CSS Classes Considered Harmful
#9Re: CSS Classes Considered Harmful
#10Data-attributes on html elements are only for JS behavior in my usage, and CSS classes are for styling.