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

On 1 November 2013 14:12, Simon Sapin <simon.sapin@exyr.org> wrote:
> 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

Thank you Bjoern and Simon for the information. I missed the link to
the dimension definition when looking at the spec.

>> 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.

The context they are used in SMIL is for the duration/begin/end point
of audio/video content. Thus, they would only make sense in CSS if
those values were expressable in CSS attributes.

Thanks for the clarification.

Thanks,
- Reece H. Dunn

Received on Friday, 1 November 2013 14:29:53 UTC