Replies: 2 comments 1 reply
-
The problem is that if you add this support to js you'll need to write it in native as well and this is all proprietary code which is prone to errors, I think we should invest in something more future proof. IDK... |
Beta Was this translation helpful? Give feedback.
1 reply
-
Sure... Least evil I guess... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Per the conversation in #1832, addressing a similar issue as I encountered in #1289, I've come across the need to extend the type signatures for existing style properties to support union types. i.e., for backwards compatibility, a style property keeps its original type A, but for future expansion, may alternatively be of type B.
In #1289, icon-padding may either be a plain number (representing equal padding on all sides), or an array of numbers (supporting CSS-style padding shorthand). To accomplish this, I introduced a new 'padding' type to the style spec.
For #1832, text-offset may either be a 2-element array, representing a single [x, y] offset, or (new extension) an array of such 2-element arrays. I could follow the same pattern as icon-padding, and introduce yet another new type (offsetCollection?) to represent the alternate types this value can take. Instead, I'm proposing a more generic solution, and explicitly listing the alternate forms directly:
Here, the new 'specs' property provides a list of alternate property value specifications. generate-style-spec and generate-style-code are updated to produce the corresponding union types:
Thoughts on this approach? Per the whole #1851 discussion, the style spec format and validation process may entirely change in the near future.
Beta Was this translation helpful? Give feedback.
All reactions