问题
I want to change the default blue color of my Sencha Touch application to green. The steps I followed are listed below:
gem update --system
gem install compass
compass create myfile
Copied a
.scss
file and pasted it in thetouch-2.2.1/resources/sqss/
directory.Pasted the following code in that file and named it
happy.css
:$base-color: #709e3f; @import 'sencha-touch/default/all'; @include sencha-panel; @include sencha-buttons; @include sencha-sheet; @include sencha-tabs; @include sencha-toolbar; @include sencha-list; @include sencha-layout; @include sencha-loading-spinner;
compass compile happy.scss
Replaced the name
happy.scss
in theapp.html
page.Ran the application, and I got the following error:
Syntax error: Undefined variable: "$font-family".\a on line 2 of /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/themes/stylesheets/sencha-touch/default/src/_Class.scss\a from line 1 of /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/themes/stylesheets/sencha-touch/default/src/_all.scss\a from line 1 of /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/themes/stylesheets/sencha-touch/default/_all.scss\a from line 3 of /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/sass/happy.scss\a\a 1: /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/sass/happy.scss
How can I solve this?
回答1:
Add the following line
@import 'sencha-touch/default';
Before this line
@import 'sencha-touch/default/all';
Also as per documentation
There are a lot of changes from Sencha Touch 2.1 to 2.2,
The most important change to be aware of is the move away from using mixins
for each component
We found that using mixins for each component was quite slow when compiling your Sass,
so we decided to simply move to using @import to just include each component.
In Touch 2.1, your stylesheet looked like this:
@import 'sencha-touch/default/all';
@include sencha-panel;
@include sencha-buttons;
// and other components…
In Touch 2.2, it looks like this:
@import 'sencha-touch/default';
@import 'sencha-touch/default/Panel';
@import 'sencha-touch/default/Button';
// and other components
来源:https://stackoverflow.com/questions/17751635/changing-default-blue-theme-to-green