Re: Is the px unit equivalent to user units?

On Jan 3, 2006, at 7:09 PM, Dean Jackson wrote:

>>>> Then:
>>>>
>>>>  * Remove the requirement that SVG places on CSS parsers to accept
>>>>    <length>s that are just <number>s.
>>
>> Do you agree with this aswell?
>
> Yeah. Sorry I responded at the wrong place.
>
> If we can have a solution where authors get to use stroke-width="4"  
> in XML content and are required to use "{stroke-width: 4px}" in  
> stylesheets, then I'm happy.

This seems like a decent solution. I don't think anyone would  
seriously object to unitless values in presentational attributes,  
they appear in HTML as well (for example elements that have a width  
attribute). So you write <img width="200"> but "{width: 200px}".

> I would be happier if CSS hadn't required units on <length>s, but I  
> have a sneaking suspicion that that won't change.

Ian pointed out that this would create parsing ambiguities for some  
properties so it seems like it would be impossible to change this  
without breaking backwards compatibility for CSS. line-height in  
particular is a very commonly used property, and "line-height: 2"  
means double the current font size, not 2px. I suppose it would be  
possible to treat dimensionless numbers as if they had px units only  
when a bare number has no other meaning, but I suspect this would be  
more confusing than helpful.

I agree, however, that this is annoying sometimes. For instance, it  
can be awkward to do math in script with dimensions that come from a  
computed style. I'm hoping a future improved CSSOM can address this.

Regards,
Maciej

Received on Wednesday, 4 January 2006 03:39:17 UTC