Re: ceil support for calculated units?

Le 11/06/2013 06:24, Netmosfera a écrit :
> I don't know if it was already suggested, but...
>
> <!-- let's say the window is 801px wide -->
> <div style="width:801px">
>       <div style="width:50%;background:red;float:left;">a</div>
>       <!-- annoying pixel line in the middle -->
>       <div style="width:50%;background:red;float:right;">b</div>
> </div>
>
> <div style="width:801px">
>       <div style="width:50%;background:red;float:left;">a</div>
>       <div style="width:ceil(50%);background:red;float:right;">b</div>
> </div>
>
> "width:floor(50%)" is the default behavior and it equals to write
> "width:50%" so it isn't really needed
>
> I haven't more use cases, do you have any, especially for newer layout
> modules?


In every case here, the used value for 'width' is 801.5px. Note that 
this is CSS pixels, which may or may not be the same as device pixels. 
For example, some newer high-resolution devices use 2 device pixels per 
CSS pixel. (In Media Queries terms, resolution: 2ddpx)

It is what CSS calls the *actual* value that may or may not be rounded 
to whole device pixels, but that rounding is completely unspecified by 
CSS. I don’t think we want to provide control over it.


However, I believe that your use case is covered by Flexbox. There 
shouldn’t be single-pixel lines between flex items because of rounding.

-- 
Simon Sapin

Received on Tuesday, 11 June 2013 12:51:34 UTC