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

SCSS compiles but SASS does not (v2.0.2) #2334

Closed
adamjgrant opened this Issue May 7, 2014 · 12 comments

Comments

Projects
None yet
5 participants
@adamjgrant

adamjgrant commented May 7, 2014

In a new project, I removed main.css and replaced it with main.sass.

I included the two lines of "---" and just wrote

body
  background-color: red

This was copied as main.sass in _site/css when building.

Changing this to main.scss and

body {
  background-color: red;
}

It compiles to main.css in _site/css as you would expect.

@parkr

This comment has been minimized.

Member

parkr commented May 7, 2014

Ref: jekyll/jekyll-help#34 You can assume that I've seen your issue if there is any activity by me on GitHub. 😃

Looking into this now.

@parkr

This comment has been minimized.

Member

parkr commented May 7, 2014

Found the issue:

[1] pry(Jekyll)> Jekyll::Converter.subclasses
=> [Jekyll::Converters::Markdown,
 Jekyll::Converters::Textile,
 Jekyll::Converters::Scss,
 Jekyll::Converters::CoffeeScript,
 Jekyll::Converters::Identity]
[2] pry(Jekyll)> Jekyll::Converters::Scss.subclasses
=> [Jekyll::Converters::Sass]
@adamjgrant

This comment has been minimized.

adamjgrant commented May 7, 2014

Thanks. I just copied it over to this repo because I had assumed I put it
in the wrong place.

@albertogg

This comment has been minimized.

Member

albertogg commented May 7, 2014

@parkr pardon my ignorance but I don't understand 😄, It shouldn't be a subclass right?

edit: It should inherit directly from Converter and not from Scss?

@parkr

This comment has been minimized.

Member

parkr commented May 7, 2014

@parkr pardon my ignorance but I don't understand , It shouldn't be a subclass right?

The Sass and SCSS converters are practically the same – only different in the input syntax and file extension. As such, we've created Jekyll::Converters::Scss which is a subclass of Jekyll::Converter, and Jekyll::Converters::Sass which is a subclass of Jekyll::Converters::Scss. When Site#instantiate_classes is called on Jekyll::Converter, it only instantiates the Scss converter, not the Sass converter. Thus, files that end in .sass are not converted.

@parkr parkr closed this in f2f2ebf May 7, 2014

parkr added a commit that referenced this issue May 7, 2014

@albertogg

This comment has been minimized.

Member

albertogg commented May 7, 2014

Thanks! @parkr

@adamjgrant

This comment has been minimized.

adamjgrant commented May 8, 2014

Awesome. When will this be applied to the public gem?

@adamjgrant

This comment has been minimized.

adamjgrant commented May 29, 2014

I'm on 2.0.3 and it's still not working. According to the docs, I need to put my .sass files in the _sass directory. I've also written in my _config.yml

sass:
  sass_dir: _sass

Just to be sure.
I also have

---
---

Above the main.sass file as required.

There is no css file created.

@adamjgrant

This comment has been minimized.

adamjgrant commented May 29, 2014

I think I found out what I was doing wrong.

Apparently, I need to put the entry point to my sass files, main.sass in the CSS folder, but the @imported sass files go in _sass, is that correct?

@matallo

This comment has been minimized.

Contributor

matallo commented May 29, 2014

@ajkochanowicz It is, and I also think the documentation is not clear enough, maybe an example with a tree view would help.

@parkr

This comment has been minimized.

Member

parkr commented May 29, 2014

Apparently, I need to put the entry point to my sass files, main.sass in the CSS folder, but the @imported sass files go in _sass, is that correct?

Yes! Any updates you think we should make to the docs would be

@adamjgrant

This comment has been minimized.

adamjgrant commented May 30, 2014

What confused me initially was that there were two [seemingly]
contradictory instructions each in different parts of the page:

"if you have a file named /css/styles.scss in your site’s source folder,
Jekyll will process it and put it in your site’s destination folder under
/css/styles.css."

(So I keep my .sass files in /css)

"you’ll need to ensure that your sass_dir is set to the base directory that
contains your Sass files...The Sass converter will default to _sass"

(I should keep my .sass files in _sass/)

For my benefit, it would be great if we could change

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

to

"While you can keep your main .sass file in css, Jekyll will look for any
@imported .sass in _sass/ by default. To change this...."

I hope this is helpful.

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.