Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Support Sass for CSS generation #192

Open
toburger opened this issue Jan 20, 2015 · 13 comments
Open

Support Sass for CSS generation #192

toburger opened this issue Jan 20, 2015 · 13 comments
Labels

Comments

@toburger
Copy link

Jekyll allows besides Less the use of Sass to generate CSS files.
It would be nice if pretzel supports it likewise.

@laedit
Copy link
Member

laedit commented Jan 20, 2015

I am good with the idea but I don't know SASS or any of the .net implementation.
Do you used any sass library in .net?
Otherwise I think to use libsass-net.

@toburger
Copy link
Author

I think the libsass-net wrapper ist the best solution on .NET so far.
I don't know of any purely native .NET lib which is able to generate SASS/SCSS at the moment.

BundleTransformer.SassAndScss is using IronRuby to compile SASS/SCSS to CSS, which is in a way "native". But I don't know if it's worth taking a dependency on IronRuby?

@JakeGinnivan
Copy link
Member

My understanding is a lot of effort is being put into libsass which is a c implementation of the ruby version.
We should use the .net wrapper around the c library imo. Which I think its libgit.net right?

Sent from my Windows Phone


From: Tobias Burgermailto:[email protected]
Sent: ý21/ý01/ý2015 07:52
To: Code52/pretzelmailto:[email protected]
Subject: Re: [pretzel] Support Sass for CSS generation (#192)

I think the libsass-net wrapper ist the best solution on .NET so far.
I don't know of any purely native .NET lib which is able to generate SASS/SCSS at the moment.

BundleTransformer.SassAndScsshttp://www.nuget.org/packages/BundleTransformer.SassAndScss is using IronRuby to compilehttp://bundletransformer.codeplex.com/SourceControl/latest#BundleTransformer.SassAndScss/Compilers/SassAndScssCompiler.cs SASS/SCSS to CSS, which is in a way "native". But I don't know if it's worth taking a dependency on IronRuby?


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

@shiftkey
Copy link
Member

I'd look at https://www.nuget.org/packages/libsassnet - seems a reasonable standalone solution.

@shiftkey
Copy link
Member

internet high five for @darrenkopp goes here

@laedit laedit added the Feature label Jan 21, 2015
@darrenkopp
Copy link

👍 💯

@vikingcode
Copy link
Contributor

This is actually fairly easy to do with libsassnet. It's primarily copy&paste the LessTransform.cs and put in libsassnet calls.

The issue is with ILMerge and the non-IL binary (LibSass.x86.dll) - it can't embed it and have a funtime with the current build script. There may be ways around that.

I know Fody/Costura work pretty well for those things, which I've switched to but having other issues around MEF.

vikingcode added a commit to vikingcode/pretzel that referenced this issue Feb 21, 2015
Solves Code52#192 - introduces Sass for CSS generation. Uses Libsassnet to provide the Sassyness.

Switches out ILMerge for Fody/Costura. When handling unmanaged assemblies, this is the best solution. This required some modifications to how MEF was used.
It uses a very specific version of Fody/Costura because of issues with VS15, I think. Please don't update it.
@darrenkopp
Copy link

So, here's what's going to happen to libsass soon, and I think it solves your concerns (and those in the other commit, but not 100% sure).

Currently the way libsass works is a plain ol' clr assembly (libsassnet.dll) which references a managed c++ assembly (libsass.*.dll). I've been working with the libsass team to have official windows dll's for libsass which I will start using (currently libsassnet is even 1 version behind because of a managed c++ limitation with C classes).

So, the idea moving forward is to use the official windows version (hopefully doesn't require visual c++ redistributable as well, but not 100% sure on this) and just p/invoke into it. There are a few benefits here:

  • I'm pretty sure this solves your IL merge/fody problems
  • It's going to make dual targeting x86 and x64 way easier
  • I think it should work with mono as well (haven't tried p/invoke on mono before)

Anyway, sorry it's taking so long, kind of waiting for the official windows driver to get released so I don't have to try to replicate all the work they did, but it hasn't come out yet.

@vikingcode
Copy link
Contributor

That's awesome! The PR with libsass works fine switching to Fody/Costura instead of ILMerge, so for Windows thats solved. My view is get the Windows version working and worry about any special 'features' for Linux. "Worst case" I hear Jekyll/ruby work okay on those platforms ;)

The mono issue is completely separate from libsass - it's simply not loading its own assemblies.

@nayanshah
Copy link

@vikingcode Curious to know if the fix is closer to being merged.

@vikingcode
Copy link
Contributor

@nayanshah No idea why it wasn't merged or if there were any outstanding issues other than it doesn't run on mono, which technically pretzel at the time didn't do anyway (and didn't until July/August).

You'd have to ask the maintainers, as I no longer care.

@darrenkopp
Copy link

darrenkopp commented Sep 18, 2015 via email

@laedit
Copy link
Member

laedit commented Sep 18, 2015

@vikingcode Sorry, I don't know why I was thinking that you wanted to wait before merging the PR.
I will review it ASAP.

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

No branches or pull requests

7 participants