W3C home > Mailing lists > Public > www-style@w3.org > April 2015

RE: CSS Classes Custom - by Leonardo Lima

From: François REMY <francois.remy.dev@outlook.com>
Date: Wed, 8 Apr 2015 21:12:26 +0200
Message-ID: <DUB405-EAS480B95D035621648B713DBA5FC0@phx.gbl>
To: "'Andrea Rendine'" <master.skywalker.88@gmail.com>, "'Leonardo Lima'" <leonardo403@gmail.com>
CC: "'www-style list'" <www-style@w3.org>
Hi Leonardo Lima, Andrea Rendine,

Thanks for taking the time to reach this place :-) 

Before moving to the topic you're the most interested in: Just to let you know, we usually don't send emails with formatting to this mailing list, to decrease mail traffic and make archiving easier. Moreover, we try to reply inline and not at the top of the mail. The reason for this choice is that it allows people to read one mail and have comments following a logical order, like I've done in this email (except this part which isn't a reply to your concerns).

> Andrea Rendine [mailto:master.skywalker.88@gmail.com] 
> Hi everybody.
> I hope this proposal can be technically achievable.

It is, since as you note preprocessors like LESS can already achieve this. The question we ask is whether we should support it and how, as doing things live in a browser has constraints which you don't have when working statically. We also try to make the features we add to CSS take advantage of the runtime nature of the operation, so that it's not only a slower alternative to a preprocessor, but brings useful additions, too.

> Has there been any similar proposal in the past?

Yes, see http://tabatkins.github.io/specs/css-extend-rule/. Would this proposal solve your needs? What's your opinion on it?

Now, as you guess, things which can be improved in CSS are many, and comments like yours help prioritize one features against another, while developer feedback on www-style isn't the only thing browser vendors take in consideration when prioritizing features, of course.

> Leonardo Lima <leonardo403@gmail.com>:
> Hi,
> After that i see css custom properties , think that if creating 
> Class custom for CSS can help us. Nowadays we have that 
> install preprocessor CSS to and using this preprocessor CSS 
> can using variables. 
> I think using (classes custom) can we have an default of 
> ("mixins") a bunch of properties from one rule-set into 
> another rule-set. 
> With this rule dont need use more preprocessor CSS. 
> Now lets change how make CSS variables, see example below:
> :root{ 
> /*create class*/ 
> --btn-default{
>     width:50px;
>     height:30px;
>     font-size:15px;
>     font-weight:bold;    
>     }
> }
> .btn-confirm{
>     class(--btn-default);/*call class*/
>     color:green;    
> }

(Previous comments also apply here)

I'm not sure I fully understood your thought. Do you propose that we allow things like this:

html {
    --quote: {
         color: blue; font-size: 150%; font-weight: bold;

html section {
    --quote: {
        color: royalblue; font-size: 125%; font-weight: bold;

blockquote, q, span.inline-quote {
    @imports --quote;

Or do you suggest something that would just be like you can do in a LESS/SASS preprocessor today?

Best regards,
Received on Wednesday, 8 April 2015 19:12:54 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:50 UTC