Hi, i want to use JSS to style my components. In KitchenSink I found two jss-files, but the classes aren't used in the project. I tried to use them without success. In the file label_basic.js one label has the id 'font_label_test'. I defined a class in the file common.jss with this name to set the font size:
#font_label_test { font-size: 100; }But it doesn't have any effect. I cleaned my project and started again, without any effect. Now my question. How can I use JSS correctly? Is a jss-file with the same name as the js-file neccessary? Is it necessary that the jss-file exists in the same folder than the js-file? ... I had a look at this page https://wiki.appcelerator.org/display/guides/Supporting+Multiple+Platforms+in+a+Single+Codebase but it doesn't make it clearer.
2 Answers
Accepted Answer
What worked for me was to create a .jss file with the same name as the .js file I was styling. So I was styling test.js with test.jss
The test.js file looks like this:
var testText = Titanium.UI.createLabel({ text:'This is a test text', id:'testtext' }) win.add(testText);and for the test.jss file:
#testtext { color:'#93b544' }
If you don't want to use JSS, then I've described a CommonJS module approach on SO here link
Your Answer
Think you can help? Login to answer this question!