Titanium JIRA Archive
Alloy (ALOY)

[ALOY-756] Alloy dynamic styling: access global app raw styles

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sAlloy 1.2.0
Fix Version/sn/a
Componentsn/a
Labelsalloy, app.tss, styling
ReporterDaniel Sefton
AssigneeUnknown
Created2013-07-23T15:41:58.000+0000
Updated2018-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

Comments

  1. Paul Hamilton 2014-07-01

    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.

JSON Source