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

Support for sass-script maps data-type? #263

Closed
danielbaars opened this issue Jan 18, 2014 · 43 comments
Closed

Support for sass-script maps data-type? #263

danielbaars opened this issue Jan 18, 2014 · 43 comments

Comments

@danielbaars
Copy link

danielbaars commented Jan 18, 2014

I'm trying to compile grid system Susy Next with libsass but every few lines it throws up an "error: error reading values after ..." message. I'm told this is because libsass does not support the sass-script maps data-type (yet).

@kennethormandy
Copy link

This isn’t a super specific answer, but I remember finding there was a lot more than just that which didn’t working with Suzy Next. The last version I had working was, I think 1.0.9, and I still had to comment a mixin out.

If you’re interested in a workaround, Harp implicitly compiles SCSS files through Node-sass and libsass, and I got that version of Susy to work with it. We were testing out using Component and Harp, so you can follow the instructions for using Harp and Susy here. If you’re not interested in Harp, that fork of Susy might still prove useful for use with libsass in the meantime.

@lunelson
Copy link

I've written a library of functions that provide all the Sass 3.3 map capabilities using lists. It's 'forward-compatible'. Meaning, when native maps arrive your code will work the same. You can modify Susy Next to work with these functions by just removing the colons (:) from the maps.

You can install it with bower install sass-list-maps or cut and paste. Read more here:

Sass List-Maps

@emagnier
Copy link

emagnier commented Feb 3, 2014

+1, would love to see the map data-type built-in in Libsass.

Here is the latest documentation about it:
https://github.com/nex3/sass/blob/master/doc-src/SASS_CHANGELOG.md#sassscript-maps

@aeharding
Copy link

This feature would be amazing for me. How quickly does this libsass adopt new features after released in Sass 3.3?

@thomaswelton
Copy link

Really want to use susy. Is libsass supposed to be up to date with the latest sass version?

@lunelson
Copy link

No, libsass is a several steps behind and does not support the complete set of features even from sass 3.2. If you choose to work with libsass you have to test all your output. The speed increase can make it worthwhile however.

@ljearwood
Copy link

I'm sorry, but because of that reason I went back to using compass.
On Mar 13, 2014 7:24 AM, "Thomas Welton" notifications@github.com wrote:

Really want to use susy. Is libsass supposed to be up to date with the
latest sass version?

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

@nicetransition
Copy link

I am afraid that I might have to jump ship too.

@thomaswelton
Copy link

libsass is significantly better. Instead of jumping ship we should be pestering scss package developers to test their code against libsass. And how off adding the new sass features until libsass can catch up.
I'm not sure of all the new stuff in sass 3.2 yet, but I'm sure the authors of susy could have written their plugin to work with libsass if they had thought it was a big enough priority. So instead of using susy for my grid I'm using zurb foundation as that compiles with libsass.

@nicetransition
Copy link

Very true -- I'm looking for a solution to be used in the next week. "jumping ship" is extreme, but for the time being I'm going back to compass. I will continue following the issues, pushes, releases until all the parts that I use are covered.

@ljearwood
Copy link

Why not just use compass, it is not as fast, granted, but it just plain
works.
On Mar 13, 2014 4:02 PM, "Thomas Welton" notifications@github.com wrote:

libsass is significantly better. Instead of jumping ship we should be
pestering scss package developers to test their code against libsass. And
how off adding the new sass features until libsass can catch up.
I'm not sure of all the new stuff in sass 3.2 yet, but I'm sure the
authors of susy could have written their plugin to work with libsass if
they had thought it was a big enough priority. So instead of using susy for
my grid I'm using zurb foundation as that compiles with libsass.

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

@thomaswelton
Copy link

Having to install ruby just to compile css is too much on my CI server.
Node does lots of stuff form me with gulp/grunt so I have that installed.
Ruby doesn't do anything else for me and want to cut it out of my stack.
Plus it's much slower in comparison.

On 13 Mar 2014, at 21:19, ljearwood notifications@github.com wrote:

Why not just use compass, it is not as fast, granted, but it just plain
works.
On Mar 13, 2014 4:02 PM, "Thomas Welton" notifications@github.com wrote:

libsass is significantly better. Instead of jumping ship we should be
pestering scss package developers to test their code against libsass. And
how off adding the new sass features until libsass can catch up.
I'm not sure of all the new stuff in sass 3.2 yet, but I'm sure the
authors of susy could have written their plugin to work with libsass if
they had thought it was a big enough priority. So instead of using susy for
my grid I'm using zurb foundation as that compiles with libsass.

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


Reply to this email directly or view it on GitHub.

@thomaswelton
Copy link

Maybe someone could design a "compiles with libsass" badge for devs to add to their readme.
Everyone loves readme badges :)

On 13 Mar 2014, at 21:19, ljearwood notifications@github.com wrote:

Why not just use compass, it is not as fast, granted, but it just plain
works.
On Mar 13, 2014 4:02 PM, "Thomas Welton" notifications@github.com wrote:

libsass is significantly better. Instead of jumping ship we should be
pestering scss package developers to test their code against libsass. And
how off adding the new sass features until libsass can catch up.
I'm not sure of all the new stuff in sass 3.2 yet, but I'm sure the
authors of susy could have written their plugin to work with libsass if
they had thought it was a big enough priority. So instead of using susy for
my grid I'm using zurb foundation as that compiles with libsass.

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


Reply to this email directly or view it on GitHub.

@ljearwood
Copy link

Ruby is extremely light, you'll be fine.
On Mar 13, 2014 4:35 PM, "Thomas Welton" notifications@github.com wrote:

Having to install ruby just to compile css is too much on my CI server.
Node does lots of stuff form me with gulp/grunt so I have that installed.
Ruby doesn't do anything else for me and want to cut it out of my stack.
Plus it's much slower in comparison.

On 13 Mar 2014, at 21:19, ljearwood notifications@github.com wrote:

Why not just use compass, it is not as fast, granted, but it just plain
works.
On Mar 13, 2014 4:02 PM, "Thomas Welton" notifications@github.com
wrote:

libsass is significantly better. Instead of jumping ship we should be
pestering scss package developers to test their code against libsass.
And
how off adding the new sass features until libsass can catch up.
I'm not sure of all the new stuff in sass 3.2 yet, but I'm sure the
authors of susy could have written their plugin to work with libsass
if
they had thought it was a big enough priority. So instead of using
susy for
my grid I'm using zurb foundation as that compiles with libsass.

Reply to this email directly or view it on GitHub<
https://github.com/hcatlin/libsass/issues/263#issuecomment-37586368>
.

Reply to this email directly or view it on GitHub.

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

@thomaswelton
Copy link

I've been there are done it. Not relying on ruby to do my css is a lot better than when I did use it. But this isn't about ruby. It's about libsass being faster and devs needing to support it.

On 13 Mar 2014, at 21:36, ljearwood notifications@github.com wrote:

Ruby is extremely light, you'll be fine.
On Mar 13, 2014 4:35 PM, "Thomas Welton" notifications@github.com wrote:

Having to install ruby just to compile css is too much on my CI server.
Node does lots of stuff form me with gulp/grunt so I have that installed.
Ruby doesn't do anything else for me and want to cut it out of my stack.
Plus it's much slower in comparison.

On 13 Mar 2014, at 21:19, ljearwood notifications@github.com wrote:

Why not just use compass, it is not as fast, granted, but it just plain
works.
On Mar 13, 2014 4:02 PM, "Thomas Welton" notifications@github.com
wrote:

libsass is significantly better. Instead of jumping ship we should be
pestering scss package developers to test their code against libsass.
And
how off adding the new sass features until libsass can catch up.
I'm not sure of all the new stuff in sass 3.2 yet, but I'm sure the
authors of susy could have written their plugin to work with libsass
if
they had thought it was a big enough priority. So instead of using
susy for
my grid I'm using zurb foundation as that compiles with libsass.

Reply to this email directly or view it on GitHub<
https://github.com/hcatlin/libsass/issues/263#issuecomment-37586368>
.

Reply to this email directly or view it on GitHub.

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


Reply to this email directly or view it on GitHub.

@lunelson
Copy link

+1 for a 'compiles with libsass' badge, this would be a good incentive.

@digitaljhelms
Copy link

@lunelson thank you for sass-list-maps! 👍 🍻

@lunelson
Copy link

@digitaljhelms glad to help.

@steffenmllr
Copy link

@digitaljhelms @lunelson did you get susy working with the sass-list-maps polyfill ?

@digitaljhelms
Copy link

I haven't used Susy.

@itanex
Copy link

itanex commented Jun 12, 2014

+1 for a 'compiles with libsass' badge

@thomaswelton
Copy link

How bad ass would it be if I wrote a micro travis style site that would run compilation tests on new commits and pull requests to allow devs to continue using the normal SCSS compiler but run CI tests against libsass.
I think that'd be pretty bad ass. 😄

@lunelson
Copy link

@thomaswelton that would be badass indeed.

@msikma
Copy link

msikma commented Jul 11, 2014

Would be very grateful if maps were implemented, since I'm using them in the framework I'm building and am considering switching to libsass. I guess I can try to work around the limitation, but I'd prefer not to.

@darkwebdev
Copy link

The problem with susy is that the old version that uses sass 3.2 also needs compass and the new version that doesn't need compass requires sass 3.3 and maps.

So I just keep using compass and susy on old projects and use libsass with bourbon and neat on new ones. And in general: no ruby = no crossplatform-and-version-problems.

@laurelnaiad
Copy link

I don't think the issue is developers forgetting to or not bothering to test against libsass... the issue is that they want/need features that are part of Ruby SASS and not (or not yet) in libsass. No amount of testing will cause them to change the decision to use those features if it is intentionally made.

That said, I'm all for the testing of sass code with libsass. I think a travis-like site to run tests of any sass code against libsass already exists -- travis itself is already capable of this, no?

@lunelson
Copy link

@stu-salsbury I'd be interested to know if such a tool exists and how to use it; I used to run tests in sassmeister or else hack a local save-on-change thing with Sublime Text 3 which updates the CSS file on changes. You could also hack Takana for a live-compiling setup.

@darkwebdev and @msikma if maps support is all that's holding you back try my sass-list-maps polyfill, the implementation is functionally the same. Unfortunately susy makes heavy use of Sass 3.3+ syntactical changes which do not provide new or different functionality but an alternate way of writing it, so porting Susy to libsass even with the polyfill is a bit tedious

@laurelnaiad
Copy link

It should be the case that you could set up a build script in node using something like gulp or grunt that executes node-sass against your sass files and evaluated the results using a testing framework. Hook that repository up to travis and you're in business. It will install your node npm devDependencies (of which node-sass would be one) as part of its install of your repo..... I am not familiar with how C++ repos are tested but I expect that if you wanted to test against libasss built from source (or even just straight compiled libsass with a C++ harness), that roughly the same technique would work. I suppose that if you wanted to test libsass without the risk of hitting any node-sass issues along the way this would be a better, still doable route to go.

@kuraga
Copy link

kuraga commented Sep 5, 2014

+1 can't compile https://github.com/thoughtbot/bourbon without it

@ogbaoghene
Copy link

+1

@darkwebdev
Copy link

@kuraga just "npm i node-bourbon"

@HamptonMakes HamptonMakes changed the title Support for sass-script maps data-type? Support for sass-script maps data-type? [$15] Sep 9, 2014
@Goltergaul
Copy link

+1

1 similar comment
@hutber
Copy link

hutber commented Sep 30, 2014

+1

@HamptonMakes
Copy link
Member

This has been completed by @xzyfer!

The entire initial specification for maps has been implemented. What isn't currently there is the each iterator, but that was added as a separate feature to Sass and will be treated the same here.

@lunelson
Copy link

lunelson commented Oct 3, 2014

With the @each operator thing, do you mean the multi-assignment thing like @each $key, $value in $map? That's the only thing missing?

@HamptonMakes
Copy link
Member

Yup, I believe so.

@msikma
Copy link

msikma commented Oct 5, 2014

This was a big deal, thanks @xzyfer!

@xzyfer
Copy link
Contributor

xzyfer commented Oct 5, 2014

Happy to help

@coxrichuk
Copy link

+1 for support sass-script maps

@ogbaoghene
Copy link

@hcatlin Really appreciate this, thanks a lot to @xzyfer. What's the plan for the @each operator though, is it something in the works?

@designorant
Copy link

@ogbaoghene It's already baked in in LibSass 3.1.

If you're having issues, make sure you're using the latest version of either: libsass/node-sass/gulp-sass/grunt-sass. You may also need to do some light refactoring/cleaning up to get rid of some workarounds.

On a side note Susy 2.2.2.alpha.1 does support LibSass now.

@xzyfer
Copy link
Contributor

xzyfer commented Jan 20, 2015

@ogbaoghene Libsass 3.1.0 has full maps and @each support. Please use http://sassmeister.com/ to verify your use case works. Feel free to open specific issues if you encounter bugs.

If you use node-sass the 2.0.0-beta has Libsass 3.1.0.

@ogbaoghene
Copy link

@designorant @xzyfer Updating grunt-sass fixed, glad no more workarounds. Thanks a lot

@HamptonMakes HamptonMakes changed the title Support for sass-script maps data-type? [$15] Support for sass-script maps data-type? [$15 awarded] Feb 21, 2015
@mgreter mgreter removed the bounty label Oct 22, 2016
@HamptonMakes HamptonMakes changed the title Support for sass-script maps data-type? [$15 awarded] Support for sass-script maps data-type? 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