TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Does CSS performance is a thing?

3 点作者 boraalparat将近 5 年前
How do we calculate it? Using a framework like twitter-bootstrap is too slow or starting from zero worth the hustle.

1 comment

phillipseamore将近 5 年前
CSS performance is a thing, both the transfer of the CSS and the actual performance of it.<p>Transferring unused CSS is a common problem, and adds weight to the page or more resources to download before rendering (rendering is blocked until all CSS has been retrieved and parsed).<p>CSS selectors have different performance, though it&#x27;s negligible on most users devices today. One common misunderstanding is the way CSS selector are processed. They are processed from right to left, so a &quot;#mystuff div&quot; will actually lookup all div&#x27;s in the page and check if it&#x27;s a child of #mystuff.<p>I never use any frameworks, they are not worth the hassle. Just start from zero (expecting you actually know enough CSS). Typically, when I write CSS from the ground up, it&#x27;s just a few kilobytes without any unnecessary code. Using more targeted CSS (I try and keep everything referring to ID&#x27;s or specific classes) you will also end up with less HTML (no &quot;button button-big button-blue button-shadow&quot; classes all over the place).