Jekyll 2.1中的SCSS @import [英] SCSS @import in Jekyll 2.1

查看:56
本文介绍了Jekyll 2.1中的SCSS @import的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个项目结构

-Project
    -css
        -main.scss
        -_sass/
            -base
            -layout
            -pages
            -vendor

main.scss文件的内容.

Content of my main.scss file.

---
---

@import "sass/base/reset";
@import "sass/base/colours";
@import "sass/base/vars-typeplate";
@import "sass/base/typeplate";

我在Jekyll文档中已经读到,为了使用SCSS语句,我必须包括sass:sass_dir:_sass.我想我必须在_config.yml中添加这一行.但是我是在我自己做的,但仍然无法正常工作.每次我尝试运行jekyll发球.我的控制台显示以下消息:

I've read in Jekyll documentation that in order to work with SCSS statements I've to include sass: sass_dir: _sass. I suppose I've to add this line over in the _config.yml. But I did it in my and it's still not working. Everytime I try to run jekyll serve. My console shows this message:

jekyll 2.1.0 | Error:  File to import not found or unreadable

推荐答案

Jekyll doc 说:如果使用Sass @import语句,您需要确保将 sass_dir 设置为包含您的Sass文件的基本目录.

Jekyll doc says : If you are using Sass @import statements, you’ll need to ensure that your sass_dir is set to the base directory that contains your Sass files.

然后为您 css/_sass .

在_config.yml中,您有:

In your _config.yml, you have :

sass:
    sass_dir: css/_sass

在css/mains.cscc中

And in css/mains.cscc

---
---

@import "reset";

就是这样.

这篇关于Jekyll 2.1中的SCSS @import的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆