2013-07-19 94 views
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. app.html頁面替換名稱happy.scss

  8. 運行應用程序,我得到了以下錯誤:

    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

我該如何解決這個問題?

回答

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. 

在觸摸2.1,樣式表是這樣的:

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

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

在觸摸2.2,它看起來像這樣:

@import 'sencha-touch/default'; 

@import 'sencha-touch/default/Panel'; 
@import 'sencha-touch/default/Button'; 
// and other components 
相關問題