Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1862] [Alloy] app.tss will override non-global styles

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-06-26T18:03:59.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
Labelsdefect, ios
ReporterMike
AssigneeMauro Parra-Miranda
Created2013-04-25T16:31:10.000+0000
Updated2016-03-08T07:40:46.000+0000

Description

According to docs "Global Styles. You can create a global style file, called app.tss, which applies all styles defined inside it to all views, but does not override the non-global styles or property attributes in the markup." Here's my Proof of concept *index.xml*
<Alloy>
	<Window id="index" layout="vertical">
		<View id="topPanel" class="topPanel" layout="horizontal" />
	</Window>
</Alloy>
*app.tss*
".x": {},
".y": {},
".z": {},
".topPanel": {
	height: 150,
	backgroundColor: 'yellow'
}
*index.tss*
".a": {},
".b": {},
".topPanel": {
	height: 150,
	backgroundColor: 'green'
}
This code above should show topPanel green right? Since "local" index.tss overrides global app.tss. Well, it doesn't. It shows yellow box. However if I change index.tss to that: *index.tss*
".a": {},
".b": {},
".c": {},
".d": {},
".topPanel": {
	height: 150,
	backgroundColor: 'green'
}
Now my background is green. I assume it has something to do with .topPanel being "lower/more far" in the JSON list. Thanks

Comments

  1. Daniel Sefton 2013-06-26

    Cannot reproduce with Ti SDK 3.1 GA or 3.1.1 GA, Alloy 1.1.3. Green is shown as expected.

JSON Source