W3C home > Mailing lists > Public > www-style@w3.org > February 2009

Re: New feature request

From: James Hopkins <james@idreamincode.co.uk>
Date: Sat, 14 Feb 2009 14:29:38 +0000
Cc: www-style@w3.org
Message-Id: <D3A91140-7AE1-454D-BB3A-A17FB475C09B@idreamincode.co.uk>
To: SimDigital - Gustavo Villa <gustavo@simdigital.com.br>
On 13 Feb 2009, at 01:50, SimDigital - Gustavo Villa wrote:

>
> Sorry for single reply. I'm newbie here keeping learning ;-)
>
> Lets go:
> I just don't want to use this:
>
> <body>
> <div class="logo defaultwidth"></div>
> <div class="search defaultwidth"></div>
> <div class="menu leftwidth"></div>
> <div class="news rightwidth"></div>
> <div class="footer defaultwidth"></div>
> </body>
>
> I'm e-commerce software distribuitor and store owners can't change  
> HTML,
> just CSS.
> In this case, maybe the logo don't will use default width for ever  
> owners.
> And, I don't want to change every class to regulate the width. I  
> prefer
> to change just one class called "defaultwidth"

My question to you would be why are you constructing a class solely to  
declare the value of the width property? Why don't you just stick each  
width property into its (more semantically written) initial class  
declaration i.e 'logo', 'search', 'menu' etc. This gives your clients  
complete control (via CSS) over what width value each element uses;  
you could go further and use the grouping syntax to organize multiple  
classes into grouped widths.

>
>
> By other way, to change news position I prefer to extend this to
> "rightblock". Just this and my news block will be positioned in the
> right place that i want, and what i need to change? One CSS line.
> Without change HTML.
> In this case, obviously my HTML will be like this:
>
> <body>
> <div class="logo"></div>
> <div class="search"></div>
> <div class="menu"></div>
> <div class="news"></div>
> <div class="footer"></div>
> </body>
>
> From my point of view is much more easy!
> Don't agree?
>
> James Hopkins escreveu:
>>
>> FYI, you need to 'Reply to All' in your mail client when replying  
>> to threads. I've CC'd www-style into this mail - hopefully it won't  
>> generate a new thread
>>
>> On 13 Feb 2009, at 00:30, SimDigital - Gustavo Villa wrote:
>>
>>> Tks James, but it is a little bit different that I propose.
>>>
>>> "Your" both ways allow to define single values variables. It isn't  
>>> the best in my point of view.
>>> I don't want to write twice what property use (@variables or  
>>> @define).
>>
>> Wrong - fantasais proposal for Constants explicitly proposes  
>> 'value', 'style-set' and 'selector' constants; Glazman/Hyatts  
>> variables proposal is a slightly 'looser' syntax, but presumably  
>> can achieve the same.
>>
>>>
>>>
>>> I think that will be much more helpfull if we EXTEND class  
>>> atributes.
>>>
>>> Today, if i want to align some elements centered with 1000px  
>>> width, i will need to do it:
>>> <style>
>>> .centerAligner {
>>> width:1000px;
>>> margin:0px auto;
>>> bla bla bla bla....
>>> }
>>> </style>
>>> and in my HTML it:
>>> <div class="myClass centerAligner"></div>
>>>
>>> I thing that is wrong! I don't need to change HTML to format my  
>>> layout. CSS need to allow me to do this without any html changes.
>>
>> I don't really understand your example and how it relates to your  
>> proposal- from what I can see you are demonstrating how you can  
>> apply multiple classes to an element? Please provide an example of  
>> your proposal based on the above 'current, real-world' example, and  
>> explain how it might work. Currently your proposal example in your  
>> initial mail looks a lot to me like a variables/constant function.
>>
>>>
>>>
>>> "Your way" solve my problem, but it is more a code solution that  
>>> format solution.
>>> My suggestion is more productive!
>>>
>>> Understand the difference between both?
>>> Dave Hyatts & Daniel Glazmans define variables. My way extends  
>>> another classes.
>>> Gosh, i really don't need variables! It don't need to be a  
>>> programmer language.
>>>
>>> Regards,
>>> Villa.
>>>
>>>
>>>
>>> James Hopkins escreveu:
>>>>
>>>> This is covered by both Dave Hyatts & Daniel Glazmans proposal  
>>>> for Variables (http://disruptive-innovations.com/zoo/ 
>>>> cssvariables/) and subsequent counter-proposal by fantasai (http://fantasai.inkedblade.net/style/specs/constants/ 
>>>> ). I recently wrote a comparison of both proposals which can be  
>>>> found at CSS3.Info (http://www.css3.info/summary-of-the-two-current-css-constants-proposals/ 
>>>> ).
>>>>
>>>> Hope this helps, and welcome to the mailing list :)
>>>>
>>>> James
>>>>
>>>>
>>>> On 12 Feb 2009, at 19:54, SimDigital - Gustavo Villa wrote:
>>>>
>>>>>
>>>>> It is allowed today? No.
>>>>>
>>>>> Why to use? To simplify CSS day-by-day maintence, once it allow  
>>>>> designers to use more cascade advantages.
>>>>>
>>>>> How does it is did today?
>>>>> if we have something like this:
>>>>> <div class="header"></div>
>>>>> <div class="content"></div>
>>>>>
>>>>> To adjust site width, we need to do it:
>>>>> 1)
>>>>> ..header { width:800px; font-size:20px;}
>>>>> ..content { width:800px; font-size:12px;}
>>>>>
>>>>> or:
>>>>> 2)
>>>>> ..header, .content {width:800px;}
>>>>> ..header {font-size:20px;}
>>>>> ..content {font-size:20px;}
>>>>>
>>>>> or still it:
>>>>> 3)
>>>>> <div class="header layoutwidth"></div>
>>>>> <div class="content layoutwidth"></div>
>>>>>
>>>>> ..layoutwidth {width:800px;}
>>>>> ..header {font-size:20px;}
>>>>> ..content {font-size:20px;}
>>>>>
>>>>>
>>>>> The problem is that if we use the solution 1, we need to read  
>>>>> all lines of CSS to be sure that we dont forget nothing.
>>>>> If we use the solution 2, we need to read all lines of HTML to  
>>>>> be sure that we dont forget nothing.
>>>>> And if we use solution 3, we will need to change HTML if in the  
>>>>> future that element dont need to be width adjusted. That  
>>>>> solution I think is poor, because CSS just need to format HTML/ 
>>>>> XHTML generated, not to change the generated code to allow  
>>>>> formating.
>>>>>
>>>>> Now, the solution that i suggest:
>>>>> Create an way to concatenate classes attributes like this:
>>>>>
>>>>> ..layoutwidth {width:800px;}
>>>>>
>>>>> ..header {
>>>>> import:.layoutwidth;
>>>>> font-size:20px;
>>>>> }
>>>>>
>>>>> ..content {
>>>>> import:.layoutwidth;
>>>>> font-size:12px;
>>>>> }
>>
>> This example to me, looks exactly like a variable/constant - you're  
>> defining a 'style-set' constant (".header") and subsequently  
>> importing it into ".header" and ".content" selector blocks.
>>
>>>>>
>>>>>
>>>>> Once changed .layoutwidth, all elements that use this format  
>>>>> will change, easily!
>>>>> It is a simple sample, but even more complex, more util this  
>>>>> feature will be.
>>>>>
>>>>> What about?
>>>>>
>>>>>
>>>>> -- 
>>>>> SimDigital - Tecnologia com resultado
>>>>>
>>>>> Visite nosso site: www.simdigital.com.br
>>>>>
>>>>> Sorocaba (15) 34117200
>>>>> Londrina (43) 33015779
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> -- 
>>> SimDigital - Tecnologia com resultado
>>>
>>> Visite nosso site: www.simdigital.com.br
>>>
>>> Sorocaba (15) 34117200
>>> Londrina (43) 33015779
>>>
>>
>>
>>
>
>
> -- 
> SimDigital - Tecnologia com resultado
>
> Visite nosso site: www.simdigital.com.br
>
> Sorocaba (15) 34117200
> Londrina (43) 33015779
>
>
Received on Saturday, 14 February 2009 14:30:23 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:16 GMT