W3C home > Mailing lists > Public > www-style@w3.org > November 2013

Re: [css3-values] Thoughts and comments on the unit types and values.

From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 01 Nov 2013 14:12:18 +0000
Message-ID: <5273B6C2.1020601@exyr.org>
To: www-style@w3.org
Le 01/11/2013 13:15, Reece Dunn a écrit :
> Hi,
>
> 1.  The css3-values spec for time units
> (http://www.w3.org/TR/css3-values/#time) does not have any examples of
> values whereas the other unit types do.
>
> Thus, it is not clear whether a value such as 23.25s is valid or not.
>
> 2.  More generally, the unit specifiers (s, kHz, dpi, cm, ...) do not
> specify their valid formats. That is, it does not make sense to have
> e.g. 0.5Hz, but 0.25kHz is logically possible. Also, are things like
> 0.1px valid or not?

As Bjoern said, this is properly defined in the spec. Any "dimension" 
value is a number that can have a fractional part. 0.5Hz and 0.1px are 
both fine and make perfect sense, although they may not do what you want.

Some properties restrict the domain of allowed values. For example:

     Negative values for 'width' are illegal.

http://www.w3.org/TR/CSS21/visudet.html#the-width-property


> 3.  Looking at the SMIL specification for time (clock) values
> [http://www.w3.org/TR/smil/smil-timing.html#Timing-ClockValueSyntax],
> it provides a more comprehensive specification of time values that
> also cover hours and minutes.
>
> 3a. Would it make sense to extend the CSS time units to cover hours
> ('h') and minutes ('min')?
>
> 3b. Would it make sense to add support for the non-unit based time
> values covered in the SMIL spec, i.e.:
>
> HHH:MM:SS.mmm
> HHH:MM:SS
> MM:SS.mmm
> MM:SS
> SS.mmm
> SS
>
> Where HHH is hours, MM is minutes, SS is seconds and mmm is
> milliseconds. See
> http://www.idpf.org/epub/30/spec/epub30-mediaoverlays.html#app-clock-examples
> for example values.

Time units in CSS are used for duration rather than clocks. Transitions 
and animations are the only usage that I know of. Minutes- or hours-long 
animations are rare enough that they’re not worth adding units. If you 
really want it, you can use a large number of seconds.

-- 
Simon Sapin
Received on Friday, 1 November 2013 14:12:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:36 UTC