Created
July 16, 2013 14:49
-
-
Save tonylukasavage/6009423 to your computer and use it in GitHub Desktop.
TSS reset for Alloy/Titanium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Label[platform=android]': { | |
color: '#000' // all platforms except Android default to black | |
} | |
'Window': { | |
backgroundColor: '#fff' // white background instead of default transparent | |
} | |
'Window[platform=android]': { | |
modal: false // make android windows all heavyweight | |
} | |
'TextField': { | |
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED // common default style | |
} |
@skypanter, I created a JIRA ticket with an alternative solution for this: https://jira.appcelerator.org/browse/TC-2621. If this gets adopted, the TSS reset could set view backgroundColors to inherit
by default.
I just think the reset TSS shouldn't break people's apps, but if the reset TSS would only be inserted into the app.tss
of newly created Alloy projects that would be less of an issue of course.
Another one I'd add:
'ImageView[platform=ios]': {
preventDefaultImage: true // never show ugly image while loading remote
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My reason is that you shouldn't use transparent backgrounds (default) unless you need to because of performance issues. UI composition takes longer if the OS needs to figure out which pixels are transparent and which values should "show through" from lower layers. This is especially a problem on Android which composites views more slowly than iOS already.
As I posted in the Google group, I think sensible defaults should be in the /styles/app.tss (including backgrounds being all white). Then, you'd override those for your particular app by setting your defaults in the /theme/styles/app.tss. If you need them to be transparent, you could set them there (or in your View's TSS files).
You could do a dev-time setting as you say to have green backgrounds with config.json settings as well.