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

Re: [Css Variables] Variable Declaration Blocks

From: David Smith <catfish.man@gmail.com>
Date: Thu, 2 Oct 2008 22:07:11 -0700
Cc: www-style@w3.org
Message-Id: <ABC91360-F0BF-4DEE-96E8-B89D74996E23@gmail.com>
To: Andrew Fedoniouk <news@terrainformatica.com>

That's an excellent point, actually. It's perhaps not quite as elegant  
but it does have the distinct advantage of working right now. A few  
lines of JS wrapping it should make it simple to update rules on the  
fly as well. I'll give it a shot and see how it works out in practice;  
thanks for the suggestion!

					David

On Oct 1, 2008, at 4:30 PM, Andrew Fedoniouk wrote:

>
> 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.
>
> http://terrainformatica.com
>
>
>>
>>                                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 Friday, 3 October 2008 05:07:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:13 GMT