Titanium JIRA Archive
Alloy (ALOY)

[ALOY-936] Alloy, TSS as js not "parsed json"

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sAlloy 2.0.0
ComponentsStyling
Labelsn/a
ReporterGuile
AssigneeUnknown
Created2014-01-23T10:21:35.000+0000
Updated2018-03-07T22:26:07.000+0000

Description

I'm really new in Titanium and don't really know what is the good way to purpose an improvement. I find TSS very powerfull and find the JSON notation very good. I disappointed me is the fact that alloy parse and compile the tss file, even if it seems to be json. Then the parser is limited to simple json expression, even if it is transform into real js like a copy/paste (or it seems to do this ;-)) A simple example of what I would like is : app/styles/index.tss "TextField": { borderWidth: 2+1 } "Button": customProjectFunction(), Which would be "transformed" into Resources/iphone/alloy/controllers/Login.js $.__views.txtMyTextField = Ti.UI.createTextField({ borderWidth: 2+1 }); $.__views.txtMyButton = Ti.UI.createButton(customProjectFunction()); I'm sure there are some reasons to do as it is now, but this feature would provide a very flexible way to make styles.

Comments

  1. Tony Lukasavage 2014-01-23

    Let me comment quickly that I mirror many of your concerns and plan to create a more robust solution for styling in the next major version of Alloy, but it will wait until 2.0, as this will be a major change involving everything from style formatting to dynamic styling to documentation and examples of all these. It is a massive change/feature that will require a substantial amount of planning to avoid it becoming a succession of band-aid fixes.

JSON Source