W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: [Css Variables] Variable Declaration Blocks

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 01 Oct 2008 16:30:38 -0700
Message-ID: <48E4081E.7050303@terrainformatica.com>
To: David Smith <catfish.man@gmail.com>
CC: www-style@w3.org

David Smith wrote:
> [skiped]
> In a number of cases, the keywords in question refer to persistent 
> attributes of a conversation such as the url of an icon representing 
> the person you're talking to, or their name, rather than per-message 
> attributes like the exact text sent. When these persistent attributes 
> change, Adium has to traverse the whole DOM looking for places where 
> they were used and updating to the new value, which is definitely less 
> than ideal. CSS variables would make this completely trivial, as well 
> as significantly faster. Instead of something like <div 
> class="message"><img 
> src="%%userIcon%%">%%displayName%%%%message%%</div> we would have <div 
> class="message %%senderID%%">%%message%%</div> and use content() and 
> background-image with variables to insert the persistent name and 
> icon. Updating when the name or icon changed would then be a simple 
> matter of setting a new value via the CSSOM.
> [skiped]
So you have dynamically generated content like this:
<div class="message %%senderID%%">....</div>

While adding new sender you need to add single rule like:

div.that-sender-id { background-image:url(that-sender-avatar.gif); ... }

by using CSSOM.

You do not need CSS variables for that until I missed something in your 
task definition ...

Andrew Fedoniouk.


>                                 David Smith
> On Oct 1, 2008, at 9:46 AM, Andrew Fedoniouk wrote:
>> Why would people need "CSS variables" at all?
>> We've got a lot of discussion around them but I am failing to
>> see the forest behind those trees.
>> Could anyone clearly explain why "CSS variables" there at all:
>> 1) What problems they are trying to solve, etc.?
>> 2) Why they are variables and not constants?
>> 3) Are there any requests from community for exactly variables?
>> Thanks in advance.
>> -- 
>> Andrew Fedoniouk.
>> http://terrainformatica.com
Received on Wednesday, 1 October 2008 23:31:25 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:40 UTC