Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[svg-native] Consider supporting CSS Variables #668

Open
litherum opened this issue Apr 16, 2019 · 5 comments
Open

[svg-native] Consider supporting CSS Variables #668

litherum opened this issue Apr 16, 2019 · 5 comments

Comments

@litherum
Copy link
Contributor

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.

@litherum
Copy link
Contributor Author

@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().

@litherum
Copy link
Contributor Author

Nested var()

@litherum
Copy link
Contributor Author

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

@dirkschulze
Copy link
Contributor

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.

@dirkschulze
Copy link
Contributor

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.

Meeting minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants