Skip to content

Source range computation implementation for the SASS parser - #569

Merged
nex3 merged 2 commits into
sass:sourcemapfrom
crdev:sourcemap_sass
Nov 27, 2012
Merged

nex3 merged 2 commits into
sass:sourcemapfrom
crdev:sourcemap_sass

Conversation

@crdev

@crdev crdev commented Nov 13, 2012

Copy link
Copy Markdown

NB: This branch is based off of sourcemap_fix_relpath, otherwise it would not make any sense.

Sourcemaps can now be constructed for nodes built while parsing SASS (engine.rb). A few fixes to the existing code have been made. All SCSS sourcemap tests have received their SASS counterparts.

Alexander Pavlov added 2 commits November 12, 2012 17:11
…t, add SASS sourcemap tests, fix Line.offset computation
@paulirish

Copy link
Copy Markdown
Member

👍 this provides a LOT of power. can't wait to see it.

@Anahkiasen

Copy link
Copy Markdown

What does it do exactly ?

@paulirish

Copy link
Copy Markdown
Member

Well the sourcemap can map all lines/columns from original sources into their destination CSS.

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 the above is ready, and this PR enables the sourcemap that can deliver the mapping from sass to the tool.

Down the line I can imagine editing values on the right styles pane of Chrome DevTools and changing the original scss source.

@matthew-dean

Copy link
Copy Markdown

Note that @paulirish says this feature is not SASS / SCSS specific and should work with any CSS pre-processing language. less/less.js#1038

@nex3
nex3 merged commit 08e805c into sass:sourcemap Nov 27, 2012
@ruudk

ruudk commented Dec 5, 2012

Copy link
Copy Markdown

When I run this command from my homedir (~):

sass --load-path ~/Downloads/ --scss --cache-location --sourcemap ~/Downloads/test.scss ~/Downloads/output.css

It creates the --sourcemap directory inside my homedirectory instead of the directory of ~/Downloads/output.css.

Is it possible to configure the location of the sourcemap?

@crdev

crdev commented Dec 5, 2012

Copy link
Copy Markdown
Author

@ruudk: You did not specify the actual cache location after --cache-location, thus sass thinks that --sourcemap IS your desired --cache-location value.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants