Re: [css3-values] dropping min()/max() on calc()

I don't pretend to have all or even the most useful use-cases,
but here are some things I've collected about my own use-cases
for calc (the numbers I typed here are purely fictionnal) :


* Most common use-case :
-------------------------------------
max-width: calc(50%-48px);


* Another use-cases :
-------------------------------------

// Calculating the width of a 'progress' element dynamicly

width: calc(100% * (attr(value) - attr(min)) / (attr(max) - attr(min))


// Ensuring a fixed element will be visible

position: fixed;
height: 25px; width: 300px;
top: calc(min(500px, 1vh-25px));
left: calc(min(30px, 1wh-300px));


// Emulate the behavior of a "DesignMode" element having a minimal
// height to be able to click into it. Could be done using min-width.

height: calc(max(1.2em, 23px));


// Do computation on variables (in this sample, we could work-around
// using the CSS box-sizing property, but we may use that in another
// context, where this property is not appliable)

@variables {
   Padding: 5px;
   Border: 2px;
   InnerWidth: 200px;
   CssBoxModelWidth: calc(InnerWidth - 2*Padding - 2*Border);
}



Regards,
François

____________________________________________________
PS: I think we should have a look at what we do in WPF using
databinding & converters (and why we use those) to see what
are the uses cases of such a technology. I don't think CSS will
ever be able to interact with ES5 objects (even if IE had the
expression() function) but being able to interact with attributes
is sufficient because ES5 can interact with the attributes, if
needed, to pass data to the Layout Engine.



-----Message d'origine----- 
From: Sylvain Galineau
Sent: Monday, September 13, 2010 12:01 AM
To: Daniel Glazman ; L. David Baron
Cc: www-style@w3.org
Subject: RE: [css3-values] dropping min()/max() on calc()

> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On
> Behalf Of Daniel Glazman


> Seen from here, and after direct chats with lots of web designers,
> calc() is the most important thing, something that will DRASTICALLY
> change their daily work if interoperably implemented.

I would love to hear more about author needs and use-cases for calc(). 

Received on Monday, 13 September 2010 18:39:30 UTC