Problem
expr() syntax in tss files currently only works in a flat style definition with no nested objects. For example, the following style definition will parse the
width
correctly, but will not properly parse the
fontSize
:
".container": {
"width": expr(Ti.Platform.displayCaps.platformWidth/2),
"font": {
"fontSize": expr(require('alloy/measurement').dpToPx(18))
}
}
Proposed Solution
Processing of style attributes needs to be performed recursively. Right now, if an object type is encountered, it is simply returned as-is with no expr() evaluations. We need to pass the object back into the style parsing function to further process it to allow expr() syntax to work.
No comments