Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

让fis-parser-sass支持node 0.8.0+ #5

Merged
merged 3 commits into from
Feb 26, 2014
Merged

Conversation

2betop
Copy link
Contributor

@2betop 2betop commented Feb 26, 2014

替换node-sass为fis-sass, 修改c++包装代码,已支持node 0.8.0+环境

fouber added a commit that referenced this pull request Feb 26, 2014
让fis-parser-sass支持node 0.8.0+
@fouber fouber merged commit 156c01a into fex-team:master Feb 26, 2014
@qdsang
Copy link

qdsang commented Feb 26, 2014

@2betop 太帅气~,要是能够支持下compass,岂不神级~

@fouber
Copy link
Contributor

fouber commented Feb 27, 2014

@2betop @qdsang

有了 fis-parser-sass 就可用用compass了啊,方法如下:

  1. 安装 fis-parser-sass 插件:

    npm install -g fis-parser-sass
  2. 下载 compass 框架

  3. 把compass框架中的 frameworks/compass/stylesheets 目录下的文件放到你的项目中,得到目录结构:

    project
      ┣ compass
      ┣ _compass.scss
      ┣ _lemonade.scss
      ┗ fis-conf.js
    
  4. 配置fis

    //项目排除掉_xxx.scss,这些属于框架文件,不用关心
    fis.config.set('project.exclude', '**/_*.scss');
    //scss后缀的文件,用fis-parser-sass插件编译
    fis.config.set('modules.parser.scss', 'sass');
    //scss文件产出为css文件
    fis.config.set('roadmap.ext.scss', 'css');
  5. 新建一个 scss 文件测试一下:

    @import "compass/layout/grid-background";
    
    a {
        background: get-baseline-gradient($color:255);
        font-weight: bold;
        text-decoration: none;
        &:hover { text-decoration: underline; }
        body.firefox & { font-weight: normal; }
    }
  6. fis release -d output

  7. 文件编译结果

    a {
      background: linear-gradient(bottom, #f00 5%, rgba(255, 0, 0, 0) 5%);
      font-weight: bold;
      text-decoration: none; }
      a:hover {
        text-decoration: underline; }
      body.firefox a {
        font-weight: normal; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants