Changing default blue theme to green

≡放荡痞女 提交于 2019-12-11 01:36:43

问题


I want to change the default blue color of my Sencha Touch application to green. The steps I followed are listed below:

  1. gem update --system

  2. gem install compass

  3. compass create myfile

  4. Copied a .scss file and pasted it in the touch-2.2.1/resources/sqss/ directory.

  5. 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;
    
  6. compass compile happy.scss

  7. Replaced the name happy.scss in the app.html page.

  8. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!