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

.sass files not supported? #16

Closed
dplummer opened this issue May 4, 2012 · 71 comments
Closed

.sass files not supported? #16

dplummer opened this issue May 4, 2012 · 71 comments

Comments

@dplummer
Copy link

dplummer commented May 4, 2012

Given the test.sass file:
div
background-color: blue

when I run "./bin/sassc test.sass" I get the error:

ERROR -- test.sass, line 1: invalid top-level expression

Is there a flag I'm missing, or is sass not supported yet? Significant whitespace is awesome.

@HamptonMakes
Copy link
Member

We have no plans to support meaningful white space with libsass.

Will accept a super well tested patch if you are passionate. Complex enough to get the more popular form working.

  • Hampton

On May 4, 2012, at 3:54 PM, Donald [email protected] wrote:

Given the test.sass file:
div
background-color: blue

when I run "./bin/sassc test.sass" I get the error:

ERROR -- test.sass, line 1: invalid top-level expression

Is there a flag I'm missing, or is sass not supported yet? Significant whitespace is awesome.


Reply to this email directly or view it on GitHub:
#16

@dplummer
Copy link
Author

dplummer commented May 5, 2012

Sad. Understandable though. Thanks!

@chriseppstein
Copy link
Contributor

Seems to me that whitespace can be supported by a preprocessing step that converts indents and outdents to curly braces and adds semicolons. shouldn't actually be that complicated.

@HamptonMakes
Copy link
Member

What about mixins and stuff?

We'd happily support this if its doable!

On Sat, May 5, 2012 at 9:23 AM, Chris Eppstein <
[email protected]

wrote:

Seems to me that whitespace can be supported by a preprocessing step that
converts indents and outdents to curly braces and adds semicolons.
shouldn't actually be that complicated.


Reply to this email directly or view it on GitHub:
#16 (comment)

@chriseppstein
Copy link
Contributor

Good point. Anyways, this can be done with a simplified parser, the differences are always the first token of the line.

@akhleung
Copy link

Sorry I didn't chime in sooner; I was on vacation. Anyway, I would like to support the indented syntax eventually -- as Chris mentioned, this may be as simple as swapping the tokenizer, but that will require a little bit of refactoring (which I was planning to do anyway).

@ianstormtaylor
Copy link

+1 on the .sass syntax :)

@goodtimeaj
Copy link

I think this may be a major factor in the adoption of libsass by non-Ruby shops, and libsass is obviously the future of Sass.

@rockwood
Copy link

+1 Our shop writes entirely in .sass format. Let me know if we can help implement this.

@akhleung
Copy link

Currently the parser and scanner are pretty tightly coupled, so adding support for the indented syntax would be complicated. I am planning to eventually decouple the scanner and parser; once that happens, it should be relatively straightforward to write a new scanner that keeps track of indentation, and swap it in when handling .sass files.

@saschamt
Copy link

+1 for this 👍
The Sass syntax is great for lots of frontend-only work.

@dbrgn
Copy link

dbrgn commented Sep 9, 2013

Support for .sass would be great.

@simonexmachina
Copy link
Contributor

+1

@askucher
Copy link

+1

@chrisspiegl
Copy link

+1 Also I'd be happy to pay a little if there would be a kick-starter like thing.

@pyronaur
Copy link

+1, and +1 for the Kickstarter like thing too.

@kennethormandy
Copy link

Hopefully this helps a little, thanks to all the contributors for the work on libsass so far.
https://www.bountysource.com/issues/1057273-sass-files-not-supported

@ctrl-b
Copy link

ctrl-b commented Nov 30, 2013

+1 for .sass

@evanpurkhiser
Copy link

👍 for .sass. Definitely prefer the meaningful whitespace over curly braces for writing style sheets.

@IlanFrumer
Copy link

+1

@askucher
Copy link

I have a hack script which converts sass syntax into scss by adding "{}" .
do you need it?

On Mon, Dec 16, 2013 at 5:16 PM, Ilan Frumer [email protected]:

+1


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-30667969
.

@IlanFrumer
Copy link

Yes, Thanks a lot.
I never thought I'll see those ugly braces again.

@andrewmartin
Copy link

👍 for .sass. Huge fan of writing less code, and it always is easier to read and understand. The shorthand syntax for mixins (= or +) is also super nice.

@askucher
Copy link

I have implemented script which converts indented script to braces. It works for me. You can get it here. And by the way you can propose your variant.

http://develton.com/#/research/indent_to_braces_function

@janhalfar
Copy link

+1

@mgreter
Copy link
Contributor

mgreter commented Dec 30, 2013

I implemented a perl script to convert indented sass syntax to scss:
https://github.com/mgreter/OCBNET-CSS3/blob/master/bin/sass2scss
Unfortunately the specification given at http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html is far from complete. I also haven't tried it on any real world examples. Can comments be indented? What to do when a line after a trailing comma has less indentation than the one before? I tried to do good guesses in those cases. Well formated files should convert fine. It's also unclear how whitespace should be interpreted in case of tabs and spaces. My implementation checks the number of chars for indetations. Maybe it's usefull for some people!

Best regards
Marcel Greter

@lozandier
Copy link

@askucher Does this way support the shorthand way of declaring mixins (=) and including mixins (+). From the version of the script I saw, it didn't seem like it did.

@mgreter
Copy link
Contributor

mgreter commented Apr 15, 2014

I've added an implementation with tests to my other pending pull request #181.
Test can be run via CSS::Sass. (see readme and comment in #181).

@mgreter
Copy link
Contributor

mgreter commented May 8, 2014

@akhleung has merged my changes into the master branch. So libsass should now be able to handle (convert) indented sass files (and also support the previous c interface correctly). But until some of you people that gave a plus 1 take the effort to verifiy it via SassC or CSS::Sass, this Ticket will stay open. Btw, If I do get the bounty, I want to put it forward to #281.

For the record: my implementation will only handle indented sass files if the filename ends with .sass. There is no way, if you load the content yourself and pass it to libsass, to tell that libsass should treat it as indented syntax. But you can convert it via sass2scss yourself beforehand!

@dplummer dplummer changed the title .sass files not supported? [$90] .sass files not supported? [$105] May 15, 2014
@akhleung
Copy link

akhleung commented Jun 5, 2014

Since no one has complained, I'm going to assume that this is working for people.

@drewwells
Copy link
Contributor

Does this work? I'm unable to get any of the examples on http://sass-lang.com/guide to work with the Sass versions.

https://gist.github.com/drewwells/86f147c30c20dcfea610

Ahh, I see that comments above that this only works with files.

@dogancelik
Copy link

@drewwells, you need to rename your file extension to .sass not .scss
libsass detects your format (indentation or braces) based on file extension.

@HamptonMakes HamptonMakes changed the title .sass files not supported? .sass files not supported? [$105 awarded] Feb 21, 2015
@mgreter mgreter removed the bounty label Oct 22, 2016
@HamptonMakes HamptonMakes changed the title .sass files not supported? [$105 awarded] .sass files not supported? Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests