Re: [css-variables] Hidden costs.

On Tue, Feb 15, 2011 at 8:25 PM, Andrew Fedoniouk
<andrew.fedoniouk@live.com> wrote:
> The problem is that no one of Web designers actually asked about exactly CSS
> Variables
> (run-time interpretable entities). Except of authors of this bright idea -
> Daniel Glazman et al.
> of course. But there are a lot of requests for CSS Constants (parse time
> macro variables).
> Just note various existing CSS macro/preprocessors and absence of anything
> even close to CSS variables (they can be modeled in principle by JS means).

Actually, they have.  An example given by an internal developer was a
table with lots of values, where some cells represented data from one
source, other cells represented data from a different source, etc.
Based on XHR data, the cells representing a source should all change
color in a particular way.

Right now the only way to do that is to either (1) loop through the
elements, setting the .style directly, or (2) use the OM to directly
tweak the color declaration in the stylesheet.

Neither is optimal.

Outside of the direct JS case, parse-time effects outside of the base
syntax are weird and harder for authors to predict.  Late-loading of
stylesheets, for example, has difficult-to-predict results if variable
resolution happens solely at parse time.

~TJ

Received on Wednesday, 16 February 2011 20:53:32 UTC