W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [css3-*] Review of functional syntax in CSS

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 21 Jan 2012 08:42:12 -0800
Message-ID: <CAAWBYDATWNan2snoMQBzyZCe+JDuMTdedbT+qfS-8aJ5AHz8hg@mail.gmail.com>
To: Christoph Päper <christoph.paeper@crissov.de>
Cc: www-style list <www-style@w3.org>
2012/1/21 Christoph Päper <christoph.paeper@crissov.de>:
> Tab Atkins Jr. (2012-01-20 03:01):
>> Rounding Functions
>> ==================
>>
>>    ''roundup(<css-value>, <modulus>)''
>>  Rationale
>>    Generalizing the round functions seems useful for calc() and other
>>    places.  The order "value then modulus" matches basically every
>>    programming language.  However, you need 1-token lookahead if you
>>    omit the comma, because the <css-value> could be any number of
>>    arbitrary tokens.  Also, the common representation of this in math
>>    uses commas.
>
> What about
>
>  <rounding> := [‘up’ | ‘down’ | ‘even’ | ‘odd’]
>
>  ‘round(’ <css-value> <rounding>? <modulus>? ‘)’
> or
>  ‘round(’ <css-value> <rounding>? [, <modulus>]? ‘)’
>
> with <modulus> defaulting to 1 of the unit specified for <css-value>?

Simon got it - you can't default the modulus unless you say something
like "if it's a length, the default modulus is 1px".  Using a keyword
or a calc() expressions or possibly other types of things can give you
a value without a definite unit.

~TJ
Received on Saturday, 21 January 2012 16:42:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:48 GMT