Open litherum opened 5 years ago
@dirkschulze says:
IMO
var()
is essential for SVG Native. That allows theming support that we need in SVG OT and applications! But we should add restirctions:
- Only on the
fill
,stroke
,stop-color
,color
properties.- Only valid Color values excluding new color values introduced with CSS3 Colors or later. So restricted to: color keywords (but system colors), HEX strings (with 3 or 6 values),
rgb()
and (possibly)var()
.
Nested var()
@jarek-foksa says:
Yeah, I think it's worth checking which features are supported by Android's VectorDrawable file format as it had very similar design goals (security, performance, ubiquity). VectorDrawable does support basic theming and even animations (which are used extensively by modern native UIs).
As a side note, this does align with the use case of native application icons as well. Theming or dark/light mode have an effect on how icons get displayed. Beside of the mentioned VectorDrawable format, XAML has themed colors as well.
In the last call we decided that we'd remove style
attribute support (and any means to specify a custom property) but do allow var()
on all presentation attributes.
OpenType fonts use CSS Variables to represent palette colors. We should decide if SVG Native should support CSS Variables, or should that support be described in the OpenType spec. If we do support CSS Variables, we'll have to be very specific about whether we support creating them or just using them, and which attributes / places in the grammar accept them.