irundaia / sbt-sassify

sbt-web plugin for Sass files
Apache License 2.0
68 stars 17 forks source link

Using web jars in Sass files #4

Closed irundaia closed 8 years ago

irundaia commented 8 years ago

Currently, it is not possible to include web jars in your own sass files. Suppose that I'm using the font-awesome web jar and I want to add some new animations to it. I wouldn't want to pollute my HTML with additional css sheets, but I want to include just one file for all font-awesome features. Then, I'd write a Sass file like:

@import "lib/font-awesome/scss/font-awesome.scss"; // Web-jarred font-awesome file

.myAnimation {
  transition: ...;
}

While this should be valid, the sbt-web sources directory does not include web-jarred Sass files. And hence it won't compile. (A possible solution would be to add a include directory to the Sass compilation context.)

irundaia commented 8 years ago

Adding the web jars directory to the include paths fixes this (see commit 75a6bcd708c0d36337800ef08fce310f6d9a860b). However, this messes up the source maps.

irundaia commented 8 years ago

The source maps are theoretically fixed (3e6284fce9170b7e1a6c88fca1536a629e80ac55). Due to a small bug in jsass, included directories aren't used when there multiple ones. Currently, I'm waiting on my fix to be merged and released. Once that's done and I've upgraded to the newer version, this issue can be closed.

irundaia commented 8 years ago

I've updated to jsass 4.0.1. This fixed the bugs.