W3C home > Mailing lists > Public > www-archive@w3.org > March 2012

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

From: Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Date: Mon, 26 Mar 2012 03:47:30 +0800
Message-ID: <4F6F7652.7060807@csail.mit.edu>
To: John Hax <johnhax@gmail.com>
CC: W3C Public Archive <www-archive@w3.org>
(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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:34:20 UTC