Re: 关于css variable草案的一点感想

(Cc -public-html-ig-zh +www-archive[1])

一封一封清

(12/03/09 20:19), John Hax wrote:
> 不过现有的草案也有缺点。最大的问题是CSS的内置处理函数太弱,只有calc(),或者属性特定的复合函数比如linear-gradient之类的。这很大程度上限制了css变量的用途。比方说缺乏像darken()这样的函数。另外因为没有mixin机制,也没有条件分支,甚至也缺乏字符串处理函数或者简单的值分割函数,所以很难基于变量做到抽象复用。由此看来,css
> variable要变成一个非常有价值的工具,可能仍待时日啊。

這段落你有想要寫成比較具體對於規範的建議嗎?如果想的話,你可以寫成一封寄
到 www-style 的信,我可以提供翻譯。大概步驟是:

1. 你寫中文信
2. 我翻譯成英文
3. 由你寄出去

之前的 lazyload 提案就是這樣提出的,JK 和教主我也照這個模式翻了兩封
信。(參考 [2])

我不做整理的工作了,太辛苦,翻譯最快。作為表示誠意,我先把這段翻了:

[[
The current draft does have drawbacks. The biggest problem is that there
are few built-in function. There's only calc() and property-specific
complex functions like 'linear-gradient', which largely limits the
usefulness of CSS variables (for example, it does not have darken()).
Also, there's no mixin, conditionals, string manipulation or other
simple value extraction functions, so it is difficult to achieve
abstract reuse based on CSS variables. Therefore, it's likely to take
quite a while before CSS variables become useful tools.
]]

(總共時間:六分鐘)

[1] 公開郵件存庫:http://lists.w3.org/Archives/Public/www-archive/
[2] http://www.w3.org/html/ig/zh/wiki/Contributions

Received on Sunday, 25 March 2012 19:48:00 UTC