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

Sourcemap support #1108

Closed
chriseppstein opened this Issue Nov 29, 2012 · 135 comments

Comments

Projects
None yet
@chriseppstein
Member

chriseppstein commented Nov 29, 2012

Now that sourcemap support has landed in Sass master, we should probably start thinking about Compass support as well. It shouldn't be too hard; Sass::Engine now has a #render_with_sourcemap method which returns a sourcemap object along with the rendered source, and Sass::Plugin::Compiler accepts a :sourcemap option to handle sourcemap generation automatically.

/cc @nex3

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Nov 29, 2012

Contributor

Just for reference:

Here is the Sass sourcemaps support PR: sass/sass#569 (now in master)

What this enables on the tool side: ctrl-click any property/value/selector and go to the location in the sass/scss where that originates: the expression, mixin, variable where it was birthed or computed. This makes the editing experience of working with sass and tweaking CSS much more enjoyable. The UI side of this is ready in the Chrome DevTools

Adding to compass means running through the compass compiler we can present this hugely improved development and debugging experience but with the full power of compass simultaneously.

Contributor

paulirish commented Nov 29, 2012

Just for reference:

Here is the Sass sourcemaps support PR: sass/sass#569 (now in master)

What this enables on the tool side: ctrl-click any property/value/selector and go to the location in the sass/scss where that originates: the expression, mixin, variable where it was birthed or computed. This makes the editing experience of working with sass and tweaking CSS much more enjoyable. The UI side of this is ready in the Chrome DevTools

Adding to compass means running through the compass compiler we can present this hugely improved development and debugging experience but with the full power of compass simultaneously.

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Nov 29, 2012

Member

Changes need to compass:

New Configuration Options

  • http_sass_dir/http_sass_path - Sass files may now be served via the internet for end users/devs to inspect in their browsers in production.
  • sourcemap_dir/sourcemap_path/http_sourcemap_dir/http_sourcemap_path - Let the user select where source maps get generated. Should default to the css directory.
  • enable_sourcemaps - a boolean option that defaults to true in development, false in production.
  • add_import_path should allow an http location for each sass folder -- if provided, we should immediately create an importer object and configure it to resolve the http path for those
  • source_unpack_dir/source_unpack_path/source_unpack_dir/source_unpack_path - this is the place where compass source files and the source files for plugins will be unpacked so they can be easily found by the browser and served by webservers. It's also where generated sprite files will be written. This should default to a sources subdirectory of the css directory.

Automatic unpacking

When sourcemaps are enabled, the sass files contained within compass's gem folder (and plugins' files) need to be unpacked into the source_unpack_dir folder that can be served over the internet. The sass loadpath entry for each plugin must be configured to know their location. Each framework/plugin will get written into it's own sub-folder according to the name of the framework.

The output format of the unpacked sass files should be converted to the user's preferred syntax if it is not already using it.

Spriting changes

The magic sass file generated by the @import directive will need to be written to the <source_unpack_dir>/compass/generated-sprites/<sprite_folder>.sass/.scss

Compiler changes

When sourcemaps are enabled, we need to call a different sass engine API and write the source map file to the location provided by the compass configuration.

Member

chriseppstein commented Nov 29, 2012

Changes need to compass:

New Configuration Options

  • http_sass_dir/http_sass_path - Sass files may now be served via the internet for end users/devs to inspect in their browsers in production.
  • sourcemap_dir/sourcemap_path/http_sourcemap_dir/http_sourcemap_path - Let the user select where source maps get generated. Should default to the css directory.
  • enable_sourcemaps - a boolean option that defaults to true in development, false in production.
  • add_import_path should allow an http location for each sass folder -- if provided, we should immediately create an importer object and configure it to resolve the http path for those
  • source_unpack_dir/source_unpack_path/source_unpack_dir/source_unpack_path - this is the place where compass source files and the source files for plugins will be unpacked so they can be easily found by the browser and served by webservers. It's also where generated sprite files will be written. This should default to a sources subdirectory of the css directory.

Automatic unpacking

When sourcemaps are enabled, the sass files contained within compass's gem folder (and plugins' files) need to be unpacked into the source_unpack_dir folder that can be served over the internet. The sass loadpath entry for each plugin must be configured to know their location. Each framework/plugin will get written into it's own sub-folder according to the name of the framework.

The output format of the unpacked sass files should be converted to the user's preferred syntax if it is not already using it.

Spriting changes

The magic sass file generated by the @import directive will need to be written to the <source_unpack_dir>/compass/generated-sprites/<sprite_folder>.sass/.scss

Compiler changes

When sourcemaps are enabled, we need to call a different sass engine API and write the source map file to the location provided by the compass configuration.

@mariusGundersen

This comment has been minimized.

Show comment
Hide comment
@mariusGundersen

mariusGundersen Jan 16, 2013

What is the state of this?

mariusGundersen commented Jan 16, 2013

What is the state of this?

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Jan 17, 2013

Contributor

afaik, no developer has taken it on. it's available if someone wants to
work on it.

On Wed, Jan 16, 2013 at 5:41 AM, Marius Gundersen
notifications@github.comwrote:

What is the state of this?


Reply to this email directly or view it on GitHubhttps://github.com/chriseppstein/compass/issues/1108#issuecomment-12318775.

Contributor

paulirish commented Jan 17, 2013

afaik, no developer has taken it on. it's available if someone wants to
work on it.

On Wed, Jan 16, 2013 at 5:41 AM, Marius Gundersen
notifications@github.comwrote:

What is the state of this?


Reply to this email directly or view it on GitHubhttps://github.com/chriseppstein/compass/issues/1108#issuecomment-12318775.

@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Jan 17, 2013

Member

This is a huge undertaking and on my list its very far down =)

Member

scottdavis commented Jan 17, 2013

This is a huge undertaking and on my list its very far down =)

@Saturate

This comment has been minimized.

Show comment
Hide comment
@Saturate

Saturate Jan 21, 2013

For people needing source maps right now, include sass_options = { :debug_info => true } in your config.rb file, and make sure output_style is not :compressed.

That will make it work very well with the SASS Option enabled in Chrome.

Saturate commented Jan 21, 2013

For people needing source maps right now, include sass_options = { :debug_info => true } in your config.rb file, and make sure output_style is not :compressed.

That will make it work very well with the SASS Option enabled in Chrome.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Feb 18, 2013

@Saturate Not in Chrome Canary, unfortunately. :( Which means in a few week there'll be no way to use even Chrome stable with SASS support with Compass.

mgol commented Feb 18, 2013

@Saturate Not in Chrome Canary, unfortunately. :( Which means in a few week there'll be no way to use even Chrome stable with SASS support with Compass.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Feb 18, 2013

A temporary workaround is:

sass --compass --sourcemap --watch style.scss:style.css

Is that any different than using

compass watch

with a correct config.rb? Can't Compass just use the already implemented SASS behavior?

mgol commented Feb 18, 2013

A temporary workaround is:

sass --compass --sourcemap --watch style.scss:style.css

Is that any different than using

compass watch

with a correct config.rb? Can't Compass just use the already implemented SASS behavior?

@Snugug

This comment has been minimized.

Show comment
Hide comment
@Snugug

Snugug Mar 17, 2013

Contributor

@Saturate The Debug Info isn't a Source Map, it's Sass Debug Info. Source Maps are very specifically a separate .map file that maps selectors/properties/etc… with their source and are a cross-language pseudo standard most commonly used with compiled JS.

@chriseppstein Interesting description of what's needed to get this off the ground. I have one concern though; if Compass is going to unpack plugins to a directory easy for the webdir to read, and the Source Map is going to point to that file, are you not concerned that users will then think that's the actual file that's being used, and therefore attempt to make changes to that file? For many plugins, that would be OK, but for many others that include Ruby, or are primarily powered by Ruby, this may provide a disconnect for users that's not easy to grok.

This all said, for an initial run, how hard would it be to simply enable Source Maps through sass_options as they would exist right now? If not just to see how it would look/work with the current limitations and quirks of the system?

Contributor

Snugug commented Mar 17, 2013

@Saturate The Debug Info isn't a Source Map, it's Sass Debug Info. Source Maps are very specifically a separate .map file that maps selectors/properties/etc… with their source and are a cross-language pseudo standard most commonly used with compiled JS.

@chriseppstein Interesting description of what's needed to get this off the ground. I have one concern though; if Compass is going to unpack plugins to a directory easy for the webdir to read, and the Source Map is going to point to that file, are you not concerned that users will then think that's the actual file that's being used, and therefore attempt to make changes to that file? For many plugins, that would be OK, but for many others that include Ruby, or are primarily powered by Ruby, this may provide a disconnect for users that's not easy to grok.

This all said, for an initial run, how hard would it be to simply enable Source Maps through sass_options as they would exist right now? If not just to see how it would look/work with the current limitations and quirks of the system?

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Mar 19, 2013

Contributor

I just succcessfully used sass --compass --sourcemap --watch style.scss:style.css as mentioned by @mzgol ... worked great.

Contributor

paulirish commented Mar 19, 2013

I just succcessfully used sass --compass --sourcemap --watch style.scss:style.css as mentioned by @mzgol ... worked great.

@Snugug

This comment has been minimized.

Show comment
Hide comment
@Snugug

Snugug Mar 19, 2013

Contributor

I will give that a try again; when I tried it said it couldn't load Compass

On Mar 19, 2013, at 2:00 AM, Paul Irish notifications@github.com wrote:

I just succcessfully used sass --compass --sourcemap --watch style.scss:style.css as mentioned by @mzgol ... worked great.


Reply to this email directly or view it on GitHub.

Contributor

Snugug commented Mar 19, 2013

I will give that a try again; when I tried it said it couldn't load Compass

On Mar 19, 2013, at 2:00 AM, Paul Irish notifications@github.com wrote:

I just succcessfully used sass --compass --sourcemap --watch style.scss:style.css as mentioned by @mzgol ... worked great.


Reply to this email directly or view it on GitHub.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Mar 19, 2013

@paulirish Actually, it seems that 'sass --compass' looks for the compass.rb file so the command I use is now even simpler; I just go to the /static dir where I keep my config.rb and invoke:
sass --compass --watch .
It works!

That's why I wonder: can't just Compass delegate to what's already implemented in Sass? Since it just works...

mgol commented Mar 19, 2013

@paulirish Actually, it seems that 'sass --compass' looks for the compass.rb file so the command I use is now even simpler; I just go to the /static dir where I keep my config.rb and invoke:
sass --compass --watch .
It works!

That's why I wonder: can't just Compass delegate to what's already implemented in Sass? Since it just works...

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Mar 19, 2013

Member

@mzgol The sass directory compiler/watcher didn't exist when I first implemented Compass's compiler/watcher. It's possible that I could delegate to it now. I would need to investigate that. However, even if I did this, things would not /just work/ because of the advanced features that compass provides on top of Sass.

Member

chriseppstein commented Mar 19, 2013

@mzgol The sass directory compiler/watcher didn't exist when I first implemented Compass's compiler/watcher. It's possible that I could delegate to it now. I would need to investigate that. However, even if I did this, things would not /just work/ because of the advanced features that compass provides on top of Sass.

@Snugug

This comment has been minimized.

Show comment
Hide comment
@Snugug

Snugug Mar 19, 2013

Contributor

@paulirish @mzgol What version of Sass/Compass are you using to get that to work? With Compass 0.13.alpha.2 and Sass 3.3.0.alpha.101 I'm getting ERROR: Cannot load compass running it from my folder that has config.rb in it.

Contributor

Snugug commented Mar 19, 2013

@paulirish @mzgol What version of Sass/Compass are you using to get that to work? With Compass 0.13.alpha.2 and Sass 3.3.0.alpha.101 I'm getting ERROR: Cannot load compass running it from my folder that has config.rb in it.

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Mar 19, 2013

Contributor

sasCompass 0.12.2 (Alnilam)
Sass 3.3.0.alpha.103 (Bleeding Edge)

On Tue, Mar 19, 2013 at 3:48 PM, Snugug notifications@github.com wrote:

@paulirish https://github.com/paulirish @mzgolhttps://github.com/mzgolWhat version of Sass/Compass are you using to get that to work? With
Compass 0.13.alpha.2 and Sass 3.3.0.alpha.101 I'm getting ERROR: Cannot
load compass running it from my folder that has config.rb in it.


Reply to this email directly or view it on GitHubhttps://github.com/chriseppstein/compass/issues/1108#issuecomment-15148517
.

Contributor

paulirish commented Mar 19, 2013

sasCompass 0.12.2 (Alnilam)
Sass 3.3.0.alpha.103 (Bleeding Edge)

On Tue, Mar 19, 2013 at 3:48 PM, Snugug notifications@github.com wrote:

@paulirish https://github.com/paulirish @mzgolhttps://github.com/mzgolWhat version of Sass/Compass are you using to get that to work? With
Compass 0.13.alpha.2 and Sass 3.3.0.alpha.101 I'm getting ERROR: Cannot
load compass running it from my folder that has config.rb in it.


Reply to this email directly or view it on GitHubhttps://github.com/chriseppstein/compass/issues/1108#issuecomment-15148517
.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Mar 19, 2013

$ sass --version
Sass 3.3.0.alpha.0.bcde875 (Bleeding Edge)

$ compass --version
Compass 0.13.alpha.2.b868089 (Markab)
(...)

mgol commented Mar 19, 2013

$ sass --version
Sass 3.3.0.alpha.0.bcde875 (Bleeding Edge)

$ compass --version
Compass 0.13.alpha.2.b868089 (Markab)
(...)
@Snugug

This comment has been minimized.

Show comment
Hide comment
@Snugug

Snugug Mar 19, 2013

Contributor

Boo, not working for me still. Dunno what's up, that's too bad, would have liked to use this,

Contributor

Snugug commented Mar 19, 2013

Boo, not working for me still. Dunno what's up, that's too bad, would have liked to use this,

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Mar 19, 2013

Are you sure you have compass binary accessible from the command line? Did you install it as a gem or from some package? (the latter can cause problems)

BTW, this is getting off-topic here, you may mail me if you want help with resolving the problem to not spam the rest as it's clearly not related to the core issue.

mgol commented Mar 19, 2013

Are you sure you have compass binary accessible from the command line? Did you install it as a gem or from some package? (the latter can cause problems)

BTW, this is getting off-topic here, you may mail me if you want help with resolving the problem to not spam the rest as it's clearly not related to the core issue.

@Saturate

This comment has been minimized.

Show comment
Hide comment
@Saturate

Saturate Mar 20, 2013

@Snugug Ah yes, but it is enabled via the "Source Maps" option in Chrome or was.

I'll try the alphas and try out source-mapping on both Windows and OSX.

Saturate commented Mar 20, 2013

@Snugug Ah yes, but it is enabled via the "Source Maps" option in Chrome or was.

I'll try the alphas and try out source-mapping on both Windows and OSX.

@benfrain

This comment has been minimized.

Show comment
Hide comment
@benfrain

benfrain Mar 22, 2013

Apologies, I'm mindful of the fact that this is polluting the primary purpose of the thread but I'd also like to try this feature out. I get the same issue as Snugug running this:

sass --compass --sourcemap --watch style.scss:style.css

I get 'ERROR: Cannot load compass.'

Sass version: Sass 3.3.0.alpha.107 (Bleeding Edge)
Compass version: Compass 0.13.alpha.2 (Markab)

If I run this sass --sourcemap --watch styles.scss:styles.css I get a little more helpful info:

error styles.scss (Line 27: File to import not found or unreadable: compass.

I only ever use Sass with Compass so it's probably some path issue I'm not aware of.

Compass is accessible from the command line - if I compass interactive for example it works fine.

benfrain commented Mar 22, 2013

Apologies, I'm mindful of the fact that this is polluting the primary purpose of the thread but I'd also like to try this feature out. I get the same issue as Snugug running this:

sass --compass --sourcemap --watch style.scss:style.css

I get 'ERROR: Cannot load compass.'

Sass version: Sass 3.3.0.alpha.107 (Bleeding Edge)
Compass version: Compass 0.13.alpha.2 (Markab)

If I run this sass --sourcemap --watch styles.scss:styles.css I get a little more helpful info:

error styles.scss (Line 27: File to import not found or unreadable: compass.

I only ever use Sass with Compass so it's probably some path issue I'm not aware of.

Compass is accessible from the command line - if I compass interactive for example it works fine.

@superstructor

This comment has been minimized.

Show comment
Hide comment
@superstructor

superstructor Mar 22, 2013

Just a note that to resolve the "ERROR: Cannot load compass." issue I downgraded compass from 0.13.alpha.2 to 0.12.2. That is all that was required to stop getting the error and have source maps work with sass --compass --sourcemap app.scss:app.css. I am using Sass 3.3.0.alpha.103.

superstructor commented Mar 22, 2013

Just a note that to resolve the "ERROR: Cannot load compass." issue I downgraded compass from 0.13.alpha.2 to 0.12.2. That is all that was required to stop getting the error and have source maps work with sass --compass --sourcemap app.scss:app.css. I am using Sass 3.3.0.alpha.103.

@benfrain

This comment has been minimized.

Show comment
Hide comment
@benfrain

benfrain Mar 22, 2013

superstructor - thanks, that got things a stage further. however, I then have problems with Susy File to import not found or unreadable: susy to it all just seems a little brittle at present until the various dependencies and plugins are down with this new world order.

@paulirish - is there any chance we'll see the sass_options = {:debug_info => true} style debug info being re-implemented in Chrome as a stop gap until this is more straightforward?

benfrain commented Mar 22, 2013

superstructor - thanks, that got things a stage further. however, I then have problems with Susy File to import not found or unreadable: susy to it all just seems a little brittle at present until the various dependencies and plugins are down with this new world order.

@paulirish - is there any chance we'll see the sass_options = {:debug_info => true} style debug info being re-implemented in Chrome as a stop gap until this is more straightforward?

@s10wen

This comment has been minimized.

Show comment
Hide comment
@s10wen

s10wen commented Apr 4, 2013

Thanks to Sam at: http://snugug.com/musings/debugging-sass-source-maps got this working.

👍

@s10wen

This comment has been minimized.

Show comment
Hide comment
@s10wen

s10wen Apr 4, 2013

Just wondering, would it be possible to add the --sourcemap into the ST2 plugin? Tried it, but didn't have much luck - https://github.com/WhatWeDo/Sublime-Text-2-Compass-Build-System

s10wen commented Apr 4, 2013

Just wondering, would it be possible to add the --sourcemap into the ST2 plugin? Tried it, but didn't have much luck - https://github.com/WhatWeDo/Sublime-Text-2-Compass-Build-System

@andfinally

This comment has been minimized.

Show comment
Hide comment
@andfinally

andfinally Apr 22, 2013

Dunno if this is helpful, but I'm just trying this with

Sass 3.3.0.alpha.121 (Bleeding Edge)
Compass 0.13.alpha.4 (Markab)

and in my config.rb I have

sass_options = {:sourcemap => true}
enable_sourcemaps = true    

and I'm running

compass compile    

And compass recompiles my CSS, but doesn't generate the map files.

andfinally commented Apr 22, 2013

Dunno if this is helpful, but I'm just trying this with

Sass 3.3.0.alpha.121 (Bleeding Edge)
Compass 0.13.alpha.4 (Markab)

and in my config.rb I have

sass_options = {:sourcemap => true}
enable_sourcemaps = true    

and I'm running

compass compile    

And compass recompiles my CSS, but doesn't generate the map files.

@foiseworth

This comment has been minimized.

Show comment
Hide comment
@foiseworth

foiseworth Apr 24, 2013

Putting:

sass_options = {:debug_info => true}

in my config.rb file worked for me (although chrome isn't picking them up... :/)

These are example of the maps I get

@media -sass-debug-info{filename{font-family:file\:\/\/\/Users\/andrew\/Personal\/Sites\/nova-the-outsiders\/themes\/c5base\/sass\/modules\/_normalize\.scss}line{font-family:\0000311}}
@media -sass-debug-info{filename{font-family:file\:\/\/\/Users\/andrew\/Personal\/Sites\/nova-the-outsiders\/themes\/c5base\/sass\/modules\/_concrete5\.scss}line{font-family:\000031}}

foiseworth commented Apr 24, 2013

Putting:

sass_options = {:debug_info => true}

in my config.rb file worked for me (although chrome isn't picking them up... :/)

These are example of the maps I get

@media -sass-debug-info{filename{font-family:file\:\/\/\/Users\/andrew\/Personal\/Sites\/nova-the-outsiders\/themes\/c5base\/sass\/modules\/_normalize\.scss}line{font-family:\0000311}}
@media -sass-debug-info{filename{font-family:file\:\/\/\/Users\/andrew\/Personal\/Sites\/nova-the-outsiders\/themes\/c5base\/sass\/modules\/_concrete5\.scss}line{font-family:\000031}}
@benfrain

This comment has been minimized.

Show comment
Hide comment
@benfrain

benfrain Apr 24, 2013

Hi Andrew, no thats the old style debug info that Chrome now doesn't pick up (put perhaps FireSass still does, haven't checked). The new style creates a separate mapping file in the CSS folder - that's the kind we are having a problem generating with Compass.

benfrain commented Apr 24, 2013

Hi Andrew, no thats the old style debug info that Chrome now doesn't pick up (put perhaps FireSass still does, haven't checked). The new style creates a separate mapping file in the CSS folder - that's the kind we are having a problem generating with Compass.

@foiseworth

This comment has been minimized.

Show comment
Hide comment
@foiseworth

foiseworth Apr 24, 2013

@benfrain - many thanks for letting me know - I'll keep trying.

foiseworth commented Apr 24, 2013

@benfrain - many thanks for letting me know - I'll keep trying.

@helixbass

This comment has been minimized.

Show comment
Hide comment
@helixbass

helixbass Apr 25, 2013

I have most of this working in the sourcemap branch of my compass fork (against Sass master, but hopefully works with any version of Sass since sourcemap support). The most obvious thing not (yet) implemented from what @chriseppstein specified above is the conversion of unpacked stylesheets to the user's preferred syntax. Source files from e.g. compass get unpacked to subdirectories of source_unpack_dir/source_unpack_path dynamically when they're referenced by a sourcemap that's getting written. Let me know if I should go ahead and submit a pull request—I'm pretty fresh to Ruby and Compass internals so please point me towards any of the code that needs reworking. I added unit and feature test coverage where it made sense to me but I don't have much grasp on how the various ways of invoking Compass interface to most of the core functionality. E.g. don't really get what Sass::Plugin is about so that interface may not work? Pretty sweet though, totally working for me in nightly-ish Chrome as described above by @paulirish.

helixbass commented Apr 25, 2013

I have most of this working in the sourcemap branch of my compass fork (against Sass master, but hopefully works with any version of Sass since sourcemap support). The most obvious thing not (yet) implemented from what @chriseppstein specified above is the conversion of unpacked stylesheets to the user's preferred syntax. Source files from e.g. compass get unpacked to subdirectories of source_unpack_dir/source_unpack_path dynamically when they're referenced by a sourcemap that's getting written. Let me know if I should go ahead and submit a pull request—I'm pretty fresh to Ruby and Compass internals so please point me towards any of the code that needs reworking. I added unit and feature test coverage where it made sense to me but I don't have much grasp on how the various ways of invoking Compass interface to most of the core functionality. E.g. don't really get what Sass::Plugin is about so that interface may not work? Pretty sweet though, totally working for me in nightly-ish Chrome as described above by @paulirish.

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Apr 25, 2013

Member

@helixbass excellent, I will review soon.

Member

chriseppstein commented Apr 25, 2013

@helixbass excellent, I will review soon.

@s10wen

This comment has been minimized.

Show comment
Hide comment
@s10wen

s10wen Apr 25, 2013

Sweet! Looking forward to this. Got it working with LiveReload for a bit and it was great, but it kept crashing.

s10wen commented Apr 25, 2013

Sweet! Looking forward to this. Got it working with LiveReload for a bit and it was great, but it kept crashing.

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein May 14, 2013

Member

Had the idea today that compass watch can just start a webserver and serve library files without copying them. I think allows us to cover the most common use cases with less mess.

Member

chriseppstein commented May 14, 2013

Had the idea today that compass watch can just start a webserver and serve library files without copying them. I think allows us to cover the most common use cases with less mess.

@Snugug

This comment has been minimized.

Show comment
Hide comment
@Snugug

Snugug May 14, 2013

Contributor

What about us not using Compass Watch and instead using a task system like Grunt to compile our stuff (done through compass compile) and run server/LiveReload/etc…? I know that's the way my team and I are moving.

Contributor

Snugug commented May 14, 2013

What about us not using Compass Watch and instead using a task system like Grunt to compile our stuff (done through compass compile) and run server/LiveReload/etc…? I know that's the way my team and I are moving.

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein May 14, 2013

Member

I suppose we could have a mode that just ran the sourcemap server.

Member

chriseppstein commented May 14, 2013

I suppose we could have a mode that just ran the sourcemap server.

@lozandier

This comment has been minimized.

Show comment
Hide comment
@lozandier

lozandier May 22, 2013

@andfinally Having the same version of SASS and Compass as you and having the same configuration applied to my config.rb file, my sourcemaps generated. My config.rb file setup is straightforward.

http_path = "/"
css_dir = ""
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"
sass_options = {:sourcemap => true,}
enable_sourcemaps = true 

My sourcemap file was style.css.map, reflecting the main stylesheet of the compass project, style.sass and style.css.

However, my sourcemaps generate, but when I inspect elements I get the correct line numbers but don't get the correct file referenced: just the sass folder as sass.

So, instead of http:/localhost/foo_site_name/main.sass:<line_number>, I'm getting http://localhost/foo_site_name/sass:<line_number>.

When I open the link referenced by the inspector, it's clear it's going to the right place to see all the sass files but it won't go to the actual .sass file/partial to utilize the line numbers it recognizes.

When I try to use merely SASS, version 3.3.0.121 and then 3.3.0.141, I get cannot load compass. Will try to downgrade Compass as @superstructor pointed out when I get the chance this evening.

@paulirish gave me a walkthrough merely using just SASS instead of with Compass earlier this month at the Adobe Max Conference of how this is supposed to work which was pretty straightforward with essentially the same versions of SASS and Compass. As a result, I'm inclined to think it's a gotcha with what's left for it it to work for me on Windows.

My main stylesheet is pretty much like a 'manifest' file importing all of the partials

@charset "UTF-8"
@import compass
@import "gridset.scss"
@import compass/reset
@import layout
@import base
@import modules 
@import themes

*Nonetheless, I've attached a photo where Chrome redirects to when I click the source map Chrome identifies that Compass generated.
image

lozandier commented May 22, 2013

@andfinally Having the same version of SASS and Compass as you and having the same configuration applied to my config.rb file, my sourcemaps generated. My config.rb file setup is straightforward.

http_path = "/"
css_dir = ""
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"
sass_options = {:sourcemap => true,}
enable_sourcemaps = true 

My sourcemap file was style.css.map, reflecting the main stylesheet of the compass project, style.sass and style.css.

However, my sourcemaps generate, but when I inspect elements I get the correct line numbers but don't get the correct file referenced: just the sass folder as sass.

So, instead of http:/localhost/foo_site_name/main.sass:<line_number>, I'm getting http://localhost/foo_site_name/sass:<line_number>.

When I open the link referenced by the inspector, it's clear it's going to the right place to see all the sass files but it won't go to the actual .sass file/partial to utilize the line numbers it recognizes.

When I try to use merely SASS, version 3.3.0.121 and then 3.3.0.141, I get cannot load compass. Will try to downgrade Compass as @superstructor pointed out when I get the chance this evening.

@paulirish gave me a walkthrough merely using just SASS instead of with Compass earlier this month at the Adobe Max Conference of how this is supposed to work which was pretty straightforward with essentially the same versions of SASS and Compass. As a result, I'm inclined to think it's a gotcha with what's left for it it to work for me on Windows.

My main stylesheet is pretty much like a 'manifest' file importing all of the partials

@charset "UTF-8"
@import compass
@import "gridset.scss"
@import compass/reset
@import layout
@import base
@import modules 
@import themes

*Nonetheless, I've attached a photo where Chrome redirects to when I click the source map Chrome identifies that Compass generated.
image

@gabrielgodoy

This comment has been minimized.

Show comment
Hide comment
@gabrielgodoy

gabrielgodoy Jun 12, 2013

Hello, I managed my compass/sass to work with the following settings:

Installed:
https://gemnasium.com/gems/compass-sourcemaps/versions/0.12.4.sourcemaps.a4836f1

Working with:

  • compass 0.12.4.sourcemaps (clavery-sourcemaps)
  • sass 3.3.0.alpha.134 (Bleeding Edge)

Hope this helps.

gabrielgodoy commented Jun 12, 2013

Hello, I managed my compass/sass to work with the following settings:

Installed:
https://gemnasium.com/gems/compass-sourcemaps/versions/0.12.4.sourcemaps.a4836f1

Working with:

  • compass 0.12.4.sourcemaps (clavery-sourcemaps)
  • sass 3.3.0.alpha.134 (Bleeding Edge)

Hope this helps.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 13, 2014

Updated ruby and getting the same issue.

ghost commented Feb 13, 2014

Updated ruby and getting the same issue.

@Sebastian-Fitzner

This comment has been minimized.

Show comment
Hide comment
@Sebastian-Fitzner

Sebastian-Fitzner Feb 24, 2014

have the same problem, does not work with newest ruby, compass and sass ...

Sebastian-Fitzner commented Feb 24, 2014

have the same problem, does not work with newest ruby, compass and sass ...

@timhettler

This comment has been minimized.

Show comment
Hide comment
@timhettler

timhettler Mar 3, 2014

This is also an issue for me. Executing the sass command with --sourcemap and --compass flags works as expected, but adding the sourcemap option to my config.rb and then running compass compile raises the same error as others are reporting.

compass 1.0.0.alpha.18
compass-core 1.0.0.alpha.17
sass 3.3.0.rc.5

timhettler commented Mar 3, 2014

This is also an issue for me. Executing the sass command with --sourcemap and --compass flags works as expected, but adding the sourcemap option to my config.rb and then running compass compile raises the same error as others are reporting.

compass 1.0.0.alpha.18
compass-core 1.0.0.alpha.17
sass 3.3.0.rc.5

@Sebastian-Fitzner

This comment has been minimized.

Show comment
Hide comment
@Sebastian-Fitzner

Sebastian-Fitzner Mar 3, 2014

the only working solution i found is the following config:
compass 1.0.0.alpha.16
compass-core 1.0.0.alpha.16
sass 3.3.0.rc.2

Sebastian-Fitzner commented Mar 3, 2014

the only working solution i found is the following config:
compass 1.0.0.alpha.16
compass-core 1.0.0.alpha.16
sass 3.3.0.rc.2

@tinganho

This comment has been minimized.

Show comment
Hide comment
@tinganho

tinganho Mar 4, 2014

@chriseppstein I just wonder what is the status of sourcemap support in compass?

tinganho commented Mar 4, 2014

@chriseppstein I just wonder what is the status of sourcemap support in compass?

@grayghostvisuals

This comment has been minimized.

Show comment
Hide comment
@grayghostvisuals

grayghostvisuals Mar 4, 2014

Wondering why this issue is still opened? It seems this issue was reopened for sass/sass#1084, but it also appears that it was merged in and the nex3 issue 1084 was closed :\

grayghostvisuals commented Mar 4, 2014

Wondering why this issue is still opened? It seems this issue was reopened for sass/sass#1084, but it also appears that it was merged in and the nex3 issue 1084 was closed :\

@leevigraham

This comment has been minimized.

Show comment
Hide comment
@leevigraham

leevigraham Mar 21, 2014

bundle exec compass compile --sourcemap works with the following Gemfile:

source "https://rubygems.org"

gem "sass",     "~> 3.3"
gem "compass",  "~> 1.0.0.alpha.19"

leevigraham commented Mar 21, 2014

bundle exec compass compile --sourcemap works with the following Gemfile:

source "https://rubygems.org"

gem "sass",     "~> 3.3"
gem "compass",  "~> 1.0.0.alpha.19"
@JacobDorman

This comment has been minimized.

Show comment
Hide comment
@JacobDorman

JacobDorman Mar 22, 2014

My previous working combination: ( grunt-contrib-sass 0.7.3 w/ compass: 'true' )

    - 'sass -v 3.3.0.alpha.149'
    - 'compass -v 0.12.2'

Confirmed - stable sass & compass --pre are now working:

Sass 3.3.4
Compass 1.0.0.alpha.19

JacobDorman commented Mar 22, 2014

My previous working combination: ( grunt-contrib-sass 0.7.3 w/ compass: 'true' )

    - 'sass -v 3.3.0.alpha.149'
    - 'compass -v 0.12.2'

Confirmed - stable sass & compass --pre are now working:

Sass 3.3.4
Compass 1.0.0.alpha.19
@grayghostvisuals

This comment has been minimized.

Show comment
Hide comment
@grayghostvisuals

grayghostvisuals Mar 22, 2014

@JacobDorman
@chriseppstein
@paulirish

Ruby 2.1.1
Compass 1.0.0.alpha.19
Sass 3.3.4

$ sass --compass --sourcemap --watch css/src/styles.scss:css/styles.css

It works, but when making changes (to a background-color for example) from the DevTools Styles Pane, these changes won't map back to the source file. Editing the original Sass file from the DevTools Sources Panel and mapping that file to the network resource will however reflect saved changes an author makes.

You can test this for yourself here https://github.com/grayghostvisuals/sourcemaps

grayghostvisuals commented Mar 22, 2014

@JacobDorman
@chriseppstein
@paulirish

Ruby 2.1.1
Compass 1.0.0.alpha.19
Sass 3.3.4

$ sass --compass --sourcemap --watch css/src/styles.scss:css/styles.css

It works, but when making changes (to a background-color for example) from the DevTools Styles Pane, these changes won't map back to the source file. Editing the original Sass file from the DevTools Sources Panel and mapping that file to the network resource will however reflect saved changes an author makes.

You can test this for yourself here https://github.com/grayghostvisuals/sourcemaps

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Mar 22, 2014

Member

@grayghostvisuals Good point. Closing now!

Member

chriseppstein commented Mar 22, 2014

@grayghostvisuals Good point. Closing now!

@Avcajaraville

This comment has been minimized.

Show comment
Hide comment
@Avcajaraville

Avcajaraville May 30, 2014

Any update regarding to this ? Im still stuck with the famous warning:

"WARNING: Compass::SpriteImporter should define the #public_url method."

when running

sass --compass --sourcemap --watch ./scss/pages/index.scss:./css/pages/index.css

Anyway, sprites & maps are getting generated, but hate to get a warning on my workflow...

Avcajaraville commented May 30, 2014

Any update regarding to this ? Im still stuck with the famous warning:

"WARNING: Compass::SpriteImporter should define the #public_url method."

when running

sass --compass --sourcemap --watch ./scss/pages/index.scss:./css/pages/index.css

Anyway, sprites & maps are getting generated, but hate to get a warning on my workflow...

@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis May 30, 2014

Member

@Avcajaraville the fix should be in master soon as in minutes

Member

scottdavis commented May 30, 2014

@Avcajaraville the fix should be in master soon as in minutes

@leopic

This comment has been minimized.

Show comment
Hide comment
@leopic

leopic Jul 30, 2014

Don't mean to beat a dead horse, but I just got this error when upgrading from alpha 19 to alpha 21:

ArgumentError on line ["55"] of /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.21/lib/compass/sprite_importer.rb: wrong number of arguments (2 for 0)
Run with --trace to see the full backtrace

So I just turned off maps for now. There used to be a warning about having to implement "public_url" back in 19, that's gone now tho...

leopic commented Jul 30, 2014

Don't mean to beat a dead horse, but I just got this error when upgrading from alpha 19 to alpha 21:

ArgumentError on line ["55"] of /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.21/lib/compass/sprite_importer.rb: wrong number of arguments (2 for 0)
Run with --trace to see the full backtrace

So I just turned off maps for now. There used to be a warning about having to implement "public_url" back in 19, that's gone now tho...

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Jul 30, 2014

Member

@leopic I'm about to release 1.0.0.rc.0 please file a new issue about this if the issue still exists in that release. please include steps to reproduce.

Member

chriseppstein commented Jul 30, 2014

@leopic I'm about to release 1.0.0.rc.0 please file a new issue about this if the issue still exists in that release. please include steps to reproduce.

@jackoverflow

This comment has been minimized.

Show comment
Hide comment
@jackoverflow

jackoverflow Aug 17, 2014

thanks to @chriseppstein for releasing compass 1.0, it also comes with sass 3.3.14. I just added "source_map: true" in my config.rb and ran "sass --compass --sourcemap --watch sass/style.scss :css/style.css" and voila!

I'm using chrome canary for my dev. ;) I hope it works for you guys as well.

jackoverflow commented Aug 17, 2014

thanks to @chriseppstein for releasing compass 1.0, it also comes with sass 3.3.14. I just added "source_map: true" in my config.rb and ran "sass --compass --sourcemap --watch sass/style.scss :css/style.css" and voila!

I'm using chrome canary for my dev. ;) I hope it works for you guys as well.

@stereokai

This comment has been minimized.

Show comment
Hide comment
@stereokai

stereokai Aug 17, 2014

Congrats on the release, it's been a long and fruitful road.

stereokai commented Aug 17, 2014

Congrats on the release, it's been a long and fruitful road.

@funkyfuture

This comment has been minimized.

Show comment
Hide comment
@funkyfuture

funkyfuture Aug 17, 2014

all Ubuntu-users should be aware that they must install ruby-dev in order to update Compass.

btw, is there a documentation of the confi.rb-options?
i'm curious, because i expected the :development to imply sourcemaps, but i need to set the sourcemap-option for sass.

funkyfuture commented Aug 17, 2014

all Ubuntu-users should be aware that they must install ruby-dev in order to update Compass.

btw, is there a documentation of the confi.rb-options?
i'm curious, because i expected the :development to imply sourcemaps, but i need to set the sourcemap-option for sass.

@stereokai

This comment has been minimized.

Show comment
Hide comment
@stereokai

stereokai Aug 17, 2014

Sourcemaps instructions for Yeoman users

It is very easy to get sourcemaps working. Official Yeoman generators usually rely on Compass with Autoprefixer to handle CSS. The steps to enable sourcemaps with these are:

  1. Uninstall both current compass and sass with Ruby gem: gem uninstall compass, gem uninstall sass
  2. Install latest Compass: gem install compass.
  3. In your Gruntfile or Gulpfile, add sourcemap: true to the Compass options block.
  4. In the Autoprefixer options block, add map: true.
  5. Rewrite /app/styles to local path ./app/styles.

If you read no. 5's "rewrite" and had visions of hours and hours of messing around with Gruntfile and npm and scouring SO for answers - fear not: I've got you covered. Just copy this snippet to your Gruntfile (replace your current connect settings). It should be easy to adjust for Gulp users.

Et viola! Sourcemaps are operational.

stereokai commented Aug 17, 2014

Sourcemaps instructions for Yeoman users

It is very easy to get sourcemaps working. Official Yeoman generators usually rely on Compass with Autoprefixer to handle CSS. The steps to enable sourcemaps with these are:

  1. Uninstall both current compass and sass with Ruby gem: gem uninstall compass, gem uninstall sass
  2. Install latest Compass: gem install compass.
  3. In your Gruntfile or Gulpfile, add sourcemap: true to the Compass options block.
  4. In the Autoprefixer options block, add map: true.
  5. Rewrite /app/styles to local path ./app/styles.

If you read no. 5's "rewrite" and had visions of hours and hours of messing around with Gruntfile and npm and scouring SO for answers - fear not: I've got you covered. Just copy this snippet to your Gruntfile (replace your current connect settings). It should be easy to adjust for Gulp users.

Et viola! Sourcemaps are operational.

@okaiji

This comment has been minimized.

Show comment
Hide comment
@okaiji

okaiji Aug 17, 2014

I was meddling with this for so long. @stereokai thanks!!

okaiji commented Aug 17, 2014

I was meddling with this for so long. @stereokai thanks!!

@funkyfuture

This comment has been minimized.

Show comment
Hide comment
@funkyfuture

funkyfuture Aug 17, 2014

@stereokai if that intended me as audience, i'm sorry it doesn't help. i don't use grunt, and have hardly an idea what it is anyway.

i just seek for some documentation for pure usage of compass in a shell. or is that so outdated?

funkyfuture commented Aug 17, 2014

@stereokai if that intended me as audience, i'm sorry it doesn't help. i don't use grunt, and have hardly an idea what it is anyway.

i just seek for some documentation for pure usage of compass in a shell. or is that so outdated?

@Snugug

This comment has been minimized.

Show comment
Hide comment
@Snugug
Contributor

Snugug commented Aug 18, 2014

@stereokai

This comment has been minimized.

Show comment
Hide comment
@stereokai

stereokai Aug 18, 2014

@funkyfuture Sorry, I wasn't posting directly to you - it had just came to my attention that I posted this in the wrong issue on the wrong repo. This was supposed to be posted to the Yeoman generator-angular repo. Regardless, I have edited my post to fit this issue.

I don't want to divert further from the topic, but to answer your question - If you're asking me, yes. Using Compass alone in a shell is outdated. However, I guess it depends on what you're doing. If you're just experimenting, I would say it's fine. From the point and beyond, task runners like Grunt or Gulp, and scaffolding suites like Yeoman, Brunch, etc., will make your life a lot easier and a lot more productive by automating your workflow as much as possible - you can look at them like a high-level way to manage and organize your projects, and automate and interact with tools like Compass et al.

@okaiji Glad I could help!

stereokai commented Aug 18, 2014

@funkyfuture Sorry, I wasn't posting directly to you - it had just came to my attention that I posted this in the wrong issue on the wrong repo. This was supposed to be posted to the Yeoman generator-angular repo. Regardless, I have edited my post to fit this issue.

I don't want to divert further from the topic, but to answer your question - If you're asking me, yes. Using Compass alone in a shell is outdated. However, I guess it depends on what you're doing. If you're just experimenting, I would say it's fine. From the point and beyond, task runners like Grunt or Gulp, and scaffolding suites like Yeoman, Brunch, etc., will make your life a lot easier and a lot more productive by automating your workflow as much as possible - you can look at them like a high-level way to manage and organize your projects, and automate and interact with tools like Compass et al.

@okaiji Glad I could help!

@leopic

This comment has been minimized.

Show comment
Hide comment
@leopic

leopic Aug 18, 2014

@chriseppstein source maps are working fine in my project now, this is g2g on my end.

leopic commented Aug 18, 2014

@chriseppstein source maps are working fine in my project now, this is g2g on my end.

@neekey

This comment has been minimized.

Show comment
Hide comment
@neekey

neekey Aug 26, 2014

request for http_sass_path support or anyway that can alternate sass file path in the source map file.

I'm writing a compass middleware for express, which compile sass files only when user request the corresponding css file. For example, when the browser request http://localhost/src/index.css, the middleware will compile /users/me/works/project/src/index.scss( actually compile the whole project ) and the css files will be generated in a temporary directory, and be served to the browser.

It works well except for the sass file path in the source map file, it will be something like ../../../../../../../users/me/works/project/src/index.scss depends on where your temp dir is.

So I hope there can be a way that I can specify the path of sass file within the source map and generate source map like "sources": ["index.scss"], and the browser will just request http://localhost/src/index.scss.

neekey commented Aug 26, 2014

request for http_sass_path support or anyway that can alternate sass file path in the source map file.

I'm writing a compass middleware for express, which compile sass files only when user request the corresponding css file. For example, when the browser request http://localhost/src/index.css, the middleware will compile /users/me/works/project/src/index.scss( actually compile the whole project ) and the css files will be generated in a temporary directory, and be served to the browser.

It works well except for the sass file path in the source map file, it will be something like ../../../../../../../users/me/works/project/src/index.scss depends on where your temp dir is.

So I hope there can be a way that I can specify the path of sass file within the source map and generate source map like "sources": ["index.scss"], and the browser will just request http://localhost/src/index.scss.

@timelf123

This comment has been minimized.

Show comment
Hide comment
@timelf123

timelf123 Aug 26, 2014

@neekey to hack around that at work we just find/replaced all the extra ../

hacky, but worked well enough for us

timelf123 commented Aug 26, 2014

@neekey to hack around that at work we just find/replaced all the extra ../

hacky, but worked well enough for us

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Aug 27, 2014

Member

@neekey Please open a new issue about this

Member

chriseppstein commented Aug 27, 2014

@neekey Please open a new issue about this

@neekey

This comment has been minimized.

Show comment
Hide comment
@neekey

neekey Aug 27, 2014

@timelf123 thank you for sharing your solution~ @chriseppstein new issue #1794

neekey commented Aug 27, 2014

@timelf123 thank you for sharing your solution~ @chriseppstein new issue #1794

tanarurkerem added a commit to tanarurkerem/compass that referenced this issue Dec 29, 2014

@chiva05

This comment has been minimized.

Show comment
Hide comment
@chiva05

chiva05 Jan 1, 2015

hi, happy new year for everyone!
i have some error run my compass watch in my first project! 👍

C:\Users\loruko\Desktop\pruebafoundation\grid-test>compass watch
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/rubygems/dependency.rb:298:in to_spe cs': Could not find 'compass' (>= 0) among 49 total gem(s) (Gem::LoadError) from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/rubygems/dependency.rb:3 09:into_spec' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel
_gem.rb:53:in gem' from C:/Ruby21/bin/compass:22:in

'

somebody can help me pls?
thanks!

chiva05 commented Jan 1, 2015

hi, happy new year for everyone!
i have some error run my compass watch in my first project! 👍

C:\Users\loruko\Desktop\pruebafoundation\grid-test>compass watch
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/rubygems/dependency.rb:298:in to_spe cs': Could not find 'compass' (>= 0) among 49 total gem(s) (Gem::LoadError) from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/rubygems/dependency.rb:3 09:into_spec' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel
_gem.rb:53:in gem' from C:/Ruby21/bin/compass:22:in

'

somebody can help me pls?
thanks!

@szarouski

This comment has been minimized.

Show comment
Hide comment
@szarouski

szarouski Jan 2, 2015

@chiva05 run gem install compass in cmd.

szarouski commented Jan 2, 2015

@chiva05 run gem install compass in cmd.

@chiva05

This comment has been minimized.

Show comment
Hide comment
@chiva05

chiva05 Jan 2, 2015

thanks! i found the problem.. I uninstall the RailsInstaller and them run again the compas watch... that work !!! 👯 hehe but thanks bro

chiva05 commented Jan 2, 2015

thanks! i found the problem.. I uninstall the RailsInstaller and them run again the compas watch... that work !!! 👯 hehe but thanks bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment