W3C home > Mailing lists > Public > www-style@w3.org > May 2009

SVG and CSS Properties (SVG ACTION-2535)

From: Doug Schepers <schepers@w3.org>
Date: Fri, 01 May 2009 03:19:01 -0400
Message-ID: <49FAA265.9000703@w3.org>
To: www-style CSS <www-style@w3.org>
CC: www-svg <www-svg@w3.org>

The SVG WG has been considering (for quite some time) adding new 
attribute value syntax to allow the mixture of absolute and relative 
values.  For example, a rectangle that sticks near the right side of the 
browser window might look like this:

  <rect x="100% - 50px" y="10px" width="40px" height="200px" />

There have been experimental implementations with various syntaxes [1], 
and Mozilla has expressed interest in this basic functionality recently [2].

In light of our mutual interest in having CSS and SVG work more 
seamlessly together, we thought a good solution (for at least the simple 
cases) would be to adopt the syntax found in CSS3 Values and Units, 
specifically the 'calc()' function.  We are wondering where this 
specification stands with the CSS WG, and what your opinion is for the 
inclusion of this into SVG as well.  We already use the 'url()' 
functional notation, and are considering expanding our use of such value 

On a related topic, the SVG WG is interested in examining allowing 
certain SVG geometric attributes to be specified using CSS, either 
inline or as classes.  Specifically, we are thinking of adding the 
following properties: x, y, width, height, cx, cy, r, rx, ry, x1, x2, 
y1, y2.  We recognize that there may be some incompatibilities between 
SVG and CSS particularly with the x, y, width, and height, but we hope 
that we can find some middle ground that serves authors best.

This would not be backwards compatible with earlier versions of SVG, but 
we are considering whether this would help authors already familiar with 
CSS to pick up SVG more quickly, and whether it could be implemented and 
deployed rapidly and interoperably enough to avoid catastrophe.  Since 
SVG is already undergoing some incompatible changes as part of 
SVG-in-text/html, this might simply be growing pains that will allow SVG 
to be used in more contexts.


[1] http://www.csse.monash.edu.au/~clm/csvg/index.html
[2] http://lists.w3.org/Archives/Public/www-svg/2008Jun/0068.html
[3] http://www.w3.org/TR/css3-values/

-Doug Schepers
W3C Team Contact, SVG and WebApps WGs
Received on Friday, 1 May 2009 07:19:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:28 UTC