-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Comments
Just for reference: Here is the Sass sourcemaps support PR: sass/sass#569 (now in master)
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. |
Changes need to compass: New Configuration Options
Automatic unpackingWhen sourcemaps are enabled, the sass files contained within compass's gem folder (and plugins' files) need to be unpacked into the 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 changesThe magic sass file generated by the Compiler changesWhen 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. |
What is the state of this? |
afaik, no developer has taken it on. it's available if someone wants to On Wed, Jan 16, 2013 at 5:41 AM, Marius Gundersen
|
This is a huge undertaking and on my list its very far down =) |
For people needing source maps right now, include That will make it work very well with the SASS Option enabled in Chrome. |
@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. |
A temporary workaround is: sass --compass --sourcemap --watch style.scss:style.css Is that any different than using compass watch with a correct |
@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 |
I just succcessfully used |
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:
|
@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: That's why I wonder: can't just Compass delegate to what's already implemented in Sass? Since it just works... |
@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. |
@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 |
sasCompass 0.12.2 (Alnilam) On Tue, Mar 19, 2013 at 3:48 PM, Snugug notifications@github.com wrote:
|
|
Boo, not working for me still. Dunno what's up, that's too bad, would have liked to use this, |
Are you sure you have 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. |
@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. |
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:
I get 'ERROR: Cannot load compass.' Sass version: Sass 3.3.0.alpha.107 (Bleeding Edge) If I run this
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 |
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 |
superstructor - thanks, that got things a stage further. however, I then have problems with Susy @paulirish - is there any chance we'll see the |
Thanks to Sam at: http://snugug.com/musings/debugging-sass-source-maps got this working. 👍 |
Just wondering, would it be possible to add the |
Dunno if this is helpful, but I'm just trying this with
and in my config.rb I have
and I'm running
And compass recompiles my CSS, but doesn't generate the map files. |
Putting:
in my config.rb file worked for me (although chrome isn't picking them up... :/) These are example of the maps I get
|
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 - many thanks for letting me know - I'll keep trying. |
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 :\ |
|
My previous working combination: ( grunt-contrib-sass 0.7.3 w/ compass: 'true' )
Confirmed - stable sass & compass --pre are now working:
|
@JacobDorman Ruby 2.1.1 $ 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 Good point. Closing now! |
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 the fix should be in master soon as in minutes |
Don't mean to beat a dead horse, but I just got this error when upgrading from alpha 19 to alpha 21:
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 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. |
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. |
Congrats on the release, it's been a long and fruitful road. |
all Ubuntu-users should be aware that they must install btw, is there a documentation of the |
Sourcemaps instructions for Yeoman usersIt 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:
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. |
I was meddling with this for so long. @stereokai thanks!! |
@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 |
@funkyfuture here is the documentation for |
@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! |
@chriseppstein source maps are working fine in my project now, this is g2g on my end. |
request for 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 It works well except for the sass file path in the source map file, it will be something like 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 |
@neekey to hack around that at work we just find/replaced all the extra hacky, but worked well enough for us |
@neekey Please open a new issue about this |
@timelf123 thank you for sharing your solution~ @chriseppstein new issue #1794 |
hi, happy new year for everyone! C:\Users\loruko\Desktop\pruebafoundation\grid-test>compass watch somebody can help me pls? |
@chiva05 run |
thanks! i found the problem.. I uninstall the RailsInstaller and them run again the compas watch... that work !!! 👯 hehe but thanks bro |
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, andSass::Plugin::Compiler
accepts a:sourcemap
option to handle sourcemap generation automatically./cc @nex3
The text was updated successfully, but these errors were encountered: