TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Building and Shipping Functional CSS

1 pointsby cjcenizalabout 9 years ago

1 comment

cjcenizalabout 9 years ago
From the article, markup that once looked like this:<p>&lt;div class=&#x27;questionCard&#x27;&gt; &lt;!-- Contents of the card --&gt; &lt;&#x2F;div&gt;<p>Now looks like this after their refactor:<p>&lt;div class=&#x27;u-relative u-mt1 u-p2 v-bg-white v-bs2&#x27;&gt; &lt;!-- The contents of the card --&gt; &lt;&#x2F;div&gt;<p>For a filesize improvement of 19kb to 9kb.<p>Personally, I feel like the new class names they&#x27;re using are extremely difficult to read and scan. I imagine the mental parsing time from reading the classes to forming a mental image of the result goes up with the addition of each class and variation. I wonder how difficult it is to discuss design decisions using these terms?<p>I&#x27;ve found that semantic, component-specific class names make it really easy to reason about markup and discuss UI changes with designers and product people. This increases maintainability and makes it easier to prune classes used by deprecated components, and also decreases iteration time when developing a UI.