[ALOY-756] Alloy dynamic styling: access global app raw styles
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Alloy 1.2.0 |
Fix Version/s | n/a |
Components | n/a |
Labels | alloy, app.tss, styling |
Reporter | Daniel Sefton |
Assignee | Unknown |
Created | 2013-07-23T15:41:58.000+0000 |
Updated | 2018-03-07T22:25:57.000+0000 |
Description
In the new dynamic styling for alloy I miss the possibility to access global styles (those defined at app.tss)
The idea is to have access to raw styles defined at app.tss in the same way as controllers tss files.
For example, to access index raw styles we can do
require('alloy/styles/index');
Which returns a sorted array of all styles defined at index.tss plus those styles inherited from app.tss and themes (if used)
The idea would be to have access also to app styles doing something like:
require('alloy/styles/app');
Accessing global styles can be useful to create new classes from the existing ones, but not for a specific component in a controller, but for generic reusable styles.
Also, if in future is possible to modify the raw styles array so it affects to all new alloy controllers created, modifying global styles makes much more sense than modifying specific controllers styles.
Discussion about this and some samples can be found at
http://developer.appcelerator.com/question/155135/alloy-dynamic-styling-access-app-raw-style-and-edit-styles
I am interested in doing this as well. Any update? Being able to change the theme dynamically based on user settings is important to me.