This guide will teach you how to generate a Sencha Theme with Sencha CMD, to start theming with Sass.
- Make sure you have Sencha CMD installed. If you don’t have Sencha Cmd installed: See this blog post.
- Make sure you have SASS/Compass/Ruby installed. No? Check this blog post.
All applications start with a “default” theme. To create new themes, you can easily generate themes with Sencha CMD.
- Navigate to your project with your console/terminal and type the following command:
sencha generate theme MyThemeName
This will generate for you the following folders:
[project]/resources/css/MyThemeName(after compiling the Sass file)
- After generating the theme, [project]/resources/sass/MyThemeName/config.rb is generated with the correct paths to all theme folders.
- From here you can start editing your SASS file.
- The next step is to build the image slices needed for IE browsers.
This is done with the following command:
sencha theme build MyThemeName
This will slice all the images in the CSS folder. This approach reduces the size of the CSS file since all image paths are relative to the CSS file location.
- You can preview your theme in your browser: [project]/resources/theme/MyThemeName/theme.html
Do you want to know more about theming Sencha with Sass? Check this blog post.
Read more info about Theming with Sencha Cmd? Check: http://docs.sencha.com/ext-js/4-1/#!/guide/command_theme