I am currently working on a Sencha application and now wish to do some styling /theming… To begin with I watched nelstrom’s tutorial. I then began my attempt at the same, placing a styles folder at root, adding config.rb and a default-theme.scss file. Theming involves getting your hands dirty with Ruby Gems again, as compass is a Ruby Gem.
So to compile with compass I required the compass ruby gem. I installed this by executing the following in a terminal window:
$ sudo gem install compass
This gave the following output:
Fetching: sass-3.1.18.gem (100%)
Fetching: chunky_png-1.2.5.gem (100%)
Fetching: fssm-0.2.9.gem (100%)
Fetching: compass-0.12.1.gem (100%)
Successfully installed sass-3.1.18
Successfully installed chunky_png-1.2.5
Successfully installed fssm-0.2.9
Successfully installed compass-0.12.1
To confirm you have the gem installed execute the following
$ gem list
This gives a list of gems installed, and compass is included.
*** LOCAL GEMS ***
That’s it… hopefully.
With compass installed I could then compile my default-theme.scss file by using the command
$ compass compile, whilst in the styles directory. This produces the default-theme.css file, which you must place a reference to in your index.html file:
<link rel="stylesheet" href="default-theme.css" type="text/css">
The styling I wanted to achieve was fairly simple. I wanted the main colour for toolbars, etc. to be black and the secondary colour a shade of orange. I also wanted to reduce some of the text size for certain classes.I managed to do all this with the following .scss file:
// You may remove any of the following modules that you
// do not use in order to create a smaller css file.
so black toolbars, etc. can be achieved with $base-color:#000;, secondary color as orange;$active-color:#FF8700; buttons with a glossy feel instead of the default matte; $base-gradient: ‘glossy’;. for shrinking down text size I’ve yet to find how to do this globally but using custom classes works by putting css direct into the .scss file, (styling for .question and .answer). You may have noticed, I am reducing the .css file by excluding many of the default @includes for the .scss file.
text: 'Show me where this is',
style: 'background: #FF8700',
This is messy as I’m not including all the styling in the css but will do for now.