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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

JSON stylesheets - screw CSS frameworks, use JavaScript - JSSS

16 点作者 JimBastard超过 15 年前

5 条评论

tptacek超过 15 年前
(1) CSS frameworks work whether or not client disable Javascript.<p>(2) Many of the problems this article's thesis lays out with CSS are solveable server-side, by preprocessing CSS.
评论 #1008921 未加载
评论 #1008853 未加载
评论 #1008844 未加载
IgorPartola超过 15 年前
This will be SLOW. Also not having vars in CSS is a blessing in disguise: otherwise business logic would be built into the stylesheet by some genius and I would Auvergne to support it. No thanks.
评论 #1008887 未加载
lanstein超过 15 年前
see also <a href="http://www.featureblend.com/css-json.html" rel="nofollow">http://www.featureblend.com/css-json.html</a>
评论 #1009036 未加载
评论 #1008985 未加载
docyes超过 15 年前
See also <a href="http://www.cssugar.com/" rel="nofollow">http://www.cssugar.com/</a>
_3ex7超过 15 年前
&#62; CSS is not a programming language - no variables, no functions, no logic<p>How is that an issue and what made you think that it was a programming language?<p>&#62; CSS properties are not cross-browser compatible<p>Neither is the DOM. Both statements are misleading because <i>most</i> CSS properties are cross-browser.<p>&#62; CSS frameworks (haml, sass, less) are meant for server-side templating and we need client-side templating<p>This is a "disadvantage" of CSS frameworks, not of CSS itself.<p>&#62; dynamically including .css files in the DOM does not guarantee CSS classes will be set cross-browser<p>Ok? Are you talking about dynamically including them client or server-side?<p>This site looks rather bland considering that it is promoting a stylesheet framework. Lets take a look at the stylesheet on this very site:<p><pre><code> &#60;style&#62; body {background-color:#000000; color:#FFFFFF; margin:20px;} a { color:#FFFFFF;} a:hover { color:#CCCCCC;} &#60;/style&#62; </code></pre> I guess this goes hand-in-hand with the grammar, which is also lacking.<p>Now lets take a look at the sample styling code:<p><pre><code> drip.toolbar.css = { height : "40px", width : "89px", position :"fixed", right : 50, bottom : 0, overflow : "hidden", cursor : "pointer", color : "#FEFEFE", "background-color": "#932c2c", "text-align" : "left", "font-family" : "Arial, Helvetica, sans-serif", "font-size" : "12px", "#drip-toolbar-button" : { height : "30px", width : "50px", cursor : "pointer", }, ".links" : { color : "#FEFEFE" } </code></pre> This is different / an improvement on CSS how? You are adding extra characters (double quotes and colon) compared to plain-old css for a more bloated stylesheet that must be downloaded? That might be considered nit-picky, but the benefit here of using JSSS is not obvious (Im still trying to figure it out).<p>Also, the 4 line example is actually 6:<p><pre><code> function parseCSS(id,css){ for(style in css){ if(typeof css[style] == 'object'){parseCSS(style,css[style]); else{$(id).css(style,css[style]);} } }; </code></pre> Comments have already been made about having javascript disabled. Perhaps a &#60;noscript&#62; tag that would pull down REAL CSS (again, what is the point of this? I am now maintaining CSS and JSSS?) would remedy.
评论 #1008971 未加载
评论 #1008980 未加载