Thursday, March 3, 2011

Custom Sencha Touch Themes - Part 3

Useful info:

This is what I've figured out about custom styling Sencha. Images are specified in SASS (and therefore, in CSS) by a function defined as:

theme_image(theme, path, mime_type = nil)


It's defined in resources\themes\lib\theme_images.rb. The "theme" parameter is one I haven't been able to figure out. It refers to Sencha theme name, that much is obvious, but it's not entirely clear how Sencha packages themes. The \resources\themes folder doesn't contain individual theme folders such as "default"; instead it is fillled with other folders. So it's difficult to say which folders belong to which theme.

The path parameter is obviously image URL. The mime_type is an optional parameter; if not specified it will encode the image as a base64. This is only recommended for things like button icons, which can be safely cached for a long time and do not change frequently.

Update: I got around the need for the theme_image function call by specifying the image URL directly. Less elegant, but this is the Sencha Touch Hack Blog.

No comments:

Post a Comment