I had the need to be able to emit source maps using libsass-python that contain sourcesContent. When I set out to make a PR to add this functionality I realized that there are quite a few libsass options not exposed through the API, and also that the cli script does not allow setting all of the options that are already exposed. With these PR, the library and cli script are brought into feature parity with other libsass bindings, such as node-sass.
Newly added kwargs include:
source_map_contents: EmitssourcesContentproperty in source map (fixes Support embedding sources' contents #268)source_map_embed: Embeds sourcemap as a data uri insourceMappingURLcommentomit_source_map_url: Omits the source map comment from the css output filesource_map_root: Sets thesourceRootproperty in a source map
All of these are exposed via the cli using the existing naming conventions, i.e. source_map_contents can be enabled with --sourcemap-contents.
Newly added cli flags that map onto already exposed libsass options:
-i/--indented-syntax: enables sass (not scss) parsing--sourcemap-file: Allows overriding ofsource_map_filenamevia the cli