26 Dec 2012 4:39 PM #1
Changes to organization of Ext JS Themes in Cmd 3.0.2
See also http://www.sencha.com/forum/showthre...-Now-Available
The guides will be updated soon. The holidays create challenges there but then again I imagine relatively few people will be looking at this for this time period.
Here is an excerpt from the new theme guide to describe the "themes as packages" structure. This will be further expanded in Cmd 3.1 but 3.0.2 should get themes reorganized along this path and that should carry forward well for future releases.
For many reasons, we want the Sencha Cmd tooling to be an enabler for people to create and ultimately share themes. The previous organization of a theme (inherited from Ext JS 4.0) made that difficult as there was no single root folder that contained all of that theme and only that theme.
In Cmd 3.0.2 and forward, themes are now contained in folders of their own in the "packages" folder. The theme formerly named "default" was renamed the "theme" package. So "resources/sass/default/app.scss" moves to "packages/theme/sass/app.scss".
resources/ # Contains SASS source code and additional resources images/ # General image content (optional) ... theme/ # The compiled form of the default "theme" images/ # Unified image content generate by build process app.css # The compiled theme red/ # The compiled form of other themes (by name) images/ app.css packages/ # Contains themes (the only packages for now) theme/ # The default theme (you can generate more here) images/ # Optional folder (content is copied if it exists) sass/ # sass input files for the default theme config.rb # Compass configuration file app.scss # Root SASS source for theme slice-src/ # Generated code for slicing (used by theme.html) ... # See below for description of these files theme.html # Web page for visual inspection and image slicing ... red/ # Other generated themes ... # Contents are the same as the default "theme" build/ # Build output appName/ # Build output for app production/ # Build output for "sencha app build production: resources/ # All files from "resources" folder .... testing/ # Build output (env = "production", "testing", etc.) ....
The image build process for a theme is in 3 steps to produce the final content of "resources/theme-name/images":
- Copy in the images from the base framework theme.
- Generate image "slices" from the CSS3 rendering for use in IE (using "packages/theme-name/theme.html" and related files)
- Copy in the content of "package/<theme-name>/images" (if it exists).
28 Dec 2012 8:58 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
If you get 404 on your images when you generate a new theme, you can do this command in the app dir to move the images into your theme's images dir:
sencha theme build [theme-name]Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
28 Dec 2012 1:32 PM #3
Good point - you will also need to run
sencha app build
1 Jan 2013 9:49 AM #4
I downloaded Cmd 3.0.2 and was able to create a custom theme perfectly except for 1 thing. The Panel headers continue to use the default theme blue gradient only in IE6-IE9. It works perfectly in Chrome, Firefox and Safari. To illustrate this better I used really dark colors so I could easily see how each element in the theme was being affected. I found this a really good way to learn how to build custom themes.
Here is an example of what it looks like in Chrome, Firefox and Safari.
When I run it in IE9 everything works except the Panel header (which also seems to affect the button rollovers too).
I have everything working in the new packages folder using sass (which by the way is a much better design). I ran the following commands to generate and build the theme and get no errors.
sencha theme build -p packages/newtheme/theme.html -o packages/ newtheme /images -image packages/ newtheme /image.png -data packages/ newtheme /data.json
sencha theme build -t newtheme
I have tried this on much more complex views and everything works except for the Panel header background in IE9. I can see all the sliced images in the images folder so I know the slicing is working too it just seems like this one piece is missing.
1 Jan 2013 4:03 PM #5
I was able to figure this out. It turns out that IE9 does not always refresh 100% and the only way to completely refresh it is to close and reopen IE9. That was throwing me because Firefox, Chrome and Safari all refresh and show the updates CSS without closing.
Another thing I had to do was set more of the SASS variables. For anyone else that is interested here are that changes to get the Panel header to change.
$panel-header-background-gradient: color-stops($dark-blue, $dark-blue);
$panel-header-font-weight: normal !default;
29 Jan 2013 5:00 AM #6
Step-by-step instructions for creating new workspace with multi-apps and shared theme
I'm a bit confused. Does the new package structure allow multiple apps to share a single (global) theme? as per this discussion http://www.sencha.com/forum/showthread.php?245718
If so please advise on steps to setup. On windows I have:
cd \ sencha -sdk ext-4.1.1a generate workspace dev\test sencha -sdk ext-4.1.1a generate app TestApp dev\test\app\testApp cd dev\test sencha generate theme foo
[ERR] Failed to determine framework path. Please ensure this command was issued from either a framework or application directory
I was expecting to create:
Are you still recommending that we create a "theme app"?