Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

IndentedSyntax not working together with importer #1192

Open
sebakerckhof opened this issue Oct 3, 2015 · 12 comments
Open

IndentedSyntax not working together with importer #1192

sebakerckhof opened this issue Oct 3, 2015 · 12 comments

Comments

@sebakerckhof
Copy link

The indentedSyntax option and the custom importer functionality don't play well together. If I set indentedsyntax to true, it works as long as I don't have any imports. If I have an import and I return a file with indented syntax, it tries to parse this as scss instead of sass.

Here's a very minimal reproduction of the issue: https://github.com/sebakerckhof/node-sass-import-test

Btw, is it valid in sass to import .sass files in .scss files or vice-versa? If so, then the importer should be able to specify for each file if it's indented syntax or not... Or the sass compiler should be smart enough to infer this from the content of a file instead of solely the filename...

@xzyfer
Copy link
Contributor

xzyfer commented Oct 5, 2015

Thanks for the report @sebakerckhof. Thanks heaps for the reproduction repo, that'll make our lives infinitely easier.

is it valid in sass to import .sass files in .scss files or vice-versa

Yes. The file extension should be used to differentiate which parser should be used.

the sass compiler should be smart enough to infer this from the content of a file instead of solely the filename

True. This is something has only very recently surfaced because so few people still used the old syntax.


There has been some discussion on how to best handle this since we will not always have the filename available i.e. importers which return data.

@chriseppstein could you please elaborate on how this is handled with Ruby Sass?

@sebakerckhof
Copy link
Author

Since this is external (in libsass). Do I need to make an issue there?
Also, would it be simple enough to let us just hint what syntax is used. E.g return

{
 indentedSyntax: true
 contents: result.data
}

from an Importer.

Or if both the contents and filename are returned, don't read the file, but use the contents and select the right syntax based on the extension of the filename ?

@mikeifomin
Copy link

So for importing *.sass files we have to wait a patch.
You guys can covert all sass to scss in one command

sass-convert -R -F sass -T scss .

@karldanninger
Copy link

+1

1 similar comment
@monsterxxx
Copy link

+1

@nscarcella
Copy link

+1

Still having this problem in 3.4.1. Had to downgrade to fourseven:scss@=3.2.0.

Has there been any news regarding this?

@mikeifomin
Copy link

Any good news with this issue?

@chriseppstein
Copy link
Contributor

@xzyfer in ruby sass, the importer specifies which syntax the content string being returned is in.

@mikeifomin
Copy link

Ruby sass ten times slower :(

On Fri, Jul 1, 2016, 10:45 PM Chris Eppstein notifications@github.com
wrote:

@xzyfer https://github.com/xzyfer in ruby sass, the importer specifies
which syntax the content string being returned is in.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1192 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAid-ZFmnQX7ge1qVr6Tjrl3npWK2MEYks5qRW5egaJpZM4GIZnd
.

@scottwillman
Copy link

I'm running into other libraries that have dependencies on the 3.4 branch and can't downgrade (not sure why). Is this being actively worked on?

@RobertWHurst
Copy link

Any chance this will get resolved?

@RobertWHurst
Copy link

I've created a bug with libsass as this is blocked there => sass/libsass#2812

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

No branches or pull requests