sass_embedded package

Subpackages

Submodules

Module contents

sass-embedded is Dart Sass bindings for Python.

sass_embedded.compile_directory(source: Path, dest: Path, load_paths: list[Path] | None = None, style: OutputStyle = 'expanded', no_sourcemap: bool = False, embed_sourcemap: bool = False, embed_sources: bool = False, source_urls: SourceMapUrl = 'relative') Result[list[Path]]

Compile all source files on specified directory.

This use Many-to-Many Mode of Dart Sass CLI.

See https://sass-lang.com/documentation/cli/dart-sass/#many-to-many-mode

Parameters:
  • source – Source path. It must have extension .sass, .scss or .css.

  • dest – Output destination.

  • load_paths – List of additional load path for Sass compile.

  • style – Output style.

  • no_sourcemap – Flag to skip generating source-maps.

  • embed_sourcemap – Flag to embed source-map into output.

  • embed_sources – Flag to embed sources into output.

  • source_urls – Style for refer to sources on source-maps.

sass_embedded.compile_file(source: Path, dest: Path, load_paths: list[Path] | None = None, style: OutputStyle = 'expanded', no_sourcemap: bool = False, embed_sourcemap: bool = False, embed_sources: bool = False, source_urls: SourceMapUrl = 'relative') Result[Path]

Convert from Sass/SCSS source to CSS.

Parameters:
  • source – Source path. It must have extension .sass, .scss or .css.

  • dest – Output destination.

  • load_paths – List of additional load path for Sass compile.

  • style – Output style.

  • no_sourcemap – Flag to skip generating source-map.

  • embed_sourcemap – Flag to embed source-map into output.

  • embed_sources – Flag to embed sources into output.

  • source_urls – Style for refer to sources on source-map.

sass_embedded.compile_string(source: str, syntax: Syntax = 'scss', load_paths: list[Path] | None = None, style: OutputStyle = 'expanded', embed_sourcemap: bool = False, embed_sources: bool = False) Result[str]

Convert from Sass/SCSS source to CSS.

Parameters:
  • source – Source text. It must be format for Sass or SCSS.

  • syntax – Source format.

  • load_paths – List of additional load path for Sass compile.

  • style – Output style.

  • embed_sourcemap – Flag to embed source-map into output.

  • embed_sources – Flag to embed sources into output. It works only when embed_sourcemap is True.