Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-755

Alloy dynamic styling: modify raw styles should affect new alloy controllers


    • Type: New Feature
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Alloy 1.2.0, Alloy 1.5.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      alloy 1.2


      While reading raw styles arrays is possible in alloy 1.2, modifying them does not affect to new alloy controllers created by Alloy.createController() or Alloy.createWidget().

      This is due to default styles are hardcoded when alloy code is pre-compiled to titanium.

      Instead of that, we have to use the new alloy method $.UI.create('component', style).

      But to force using $.UI.create() means to create the UI from the controller file, so all the powerful and flexibility of xml+tss files is lost.

      Instead of that, I suggest that modifying the raw styles overwrites the default styles hardcoded by alloy. I understand this is not a trivial feature, but I think this behavior is more in the line of what Alloy is and what means for the developers.

      As an example, if I have a class called "H1" and I modify it, I expect that all new components using that class will be affected and will use the new style.

      Related to TC-2646, the ideal would be that, if the style is in the global styles array, that style would be also inherited by every controller using that class.

      Discussion and examples can be found at http://developer.appcelerator.com/question/155135/alloy-dynamic-styling-access-app-raw-style-and-edit-styles


          Issue Links



              • Assignee:
                fmiao Feon Sua Xin Miao
                dsefton Daniel Sefton
              • Watchers:
                8 Start watching this issue


                • Created:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration