csstitaniumtitanium-alloytss

Titanium Alloy - TSS vs. CSS?


I've just started coding with Titanium Alloy. Having previously learned JavaScript, HTML, and CSS through many different resources, I'm a little confused with Titanium's (Appcelerator's) version of style sheets.

What are the differences between Titanium's TSS and normal CSS coding? Are there any good resources to aid in learning TSS from a background with an introductory level CSS knowledge?

Thanks in advance for the help!


Solution

  • TSS is completely different from CSS. There are some similarities, but it should be quickly forgotten.

    For example, CSS does textAlign: center, TSS does something similar, but will throw an error if you copy past it, you need to wrap center in quotes: textAlign: 'center'.

    In alloy TSS and the XML files are generated to the "classic" Javascript files. So basically all properties you usually set in a createView method, you can now set in the TSS. Which makes the files a whole lot smaller and completer

    For how TSS works I strongly advice you to dive into the documentation of Titanium and look at the "classic" documentation or, if available, the Alloy documentation. For example at a text field: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextField