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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: XS.js - an ultra-small CSS rule builder in 10 lines of JS

1 点作者 plugnburn大约 9 年前

1 comment

plugnburn大约 9 年前
Some explanations:<p>- this is a companion to previously announced XT.js, but for dynamic CSS construction;<p>- ES5 compatible;<p>- no at-rule support at this point (as we are on JS, .matchMedia FTW, and dynamic @keyframes building is too specific task to multiply the size twice and more);<p>- due to engine limitations we have to already insert the &lt;style&gt; element into &lt;head&gt; before we can even start appending rules, so, unlike XT.js, a reference to already inserted &lt;style&gt; is returned.