2

我想将 Sencha Touch 应用程序的默认蓝色更改为绿色。我遵循的步骤如下:

  1. gem update --system

  2. gem install compass

  3. compass create myfile

  4. 复制一个.scss文件并将其粘贴到touch-2.2.1/resources/sqss/目录中。

  5. 将以下代码粘贴到该文件中并将其命名为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. 替换了happy.scss页面中app.html的名称。

  8. 运行应用程序,我收到以下错误:

    语法错误:未定义变量:“$font-family”。\a 在 /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/themes/stylesheets/sencha-touch/default/src/_Class 的第 2 行。 scss\a 来自 /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/themes/stylesheets/sencha-touch/default/src/_all.scss\a 来自 /Applications/XAMPP/ 第 1 行的第 1 行xamppfiles/htdocs/touch-2.2.1/resources/themes/stylesheets/sencha-touch/default/_all.scss\a 来自 /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/sass/ 的第 3 行happy.scss\a\a 1: /Applications/XAMPP/xamppfiles/htdocs/touch-2.2.1/resources/sass/happy.scss

我该如何解决这个问题?

4

1 回答 1

3

添加以下行

@import 'sencha-touch/default';

在此行之前

@import 'sencha-touch/default/all';

也根据文档

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.

在 Touch 2.1 中,您的样式表如下所示:

@import 'sencha-touch/default/all';

@include sencha-panel;
@include sencha-buttons;
// and other components…

在 Touch 2.2 中,它看起来像这样:

@import 'sencha-touch/default';

@import 'sencha-touch/default/Panel';
@import 'sencha-touch/default/Button';
// and other components
于 2013-07-20T03:11:26.940 回答