atsphinx.toybox.sass

Note

Added by v2024.12.2

Overview

This compiles SASS/SCSS resources into css when run sphinx-build. This it to embed Stlite content into your documents.

Usage

Enable extension

Add this into your conf.py of Sphinx.

conf.py
extensions = [
    "atsphinx.toybox.sass",
]

Configuration

There are not configuration options.

sass_load_paths
Type: list[str]
Default: []

List of paths for external modules. This is useful to compile SASS/SCSS with third-party libraries.

sass_extra_options
Type: list[str]
Default: []

Extra options for compile.

See also: https://sass-lang.com/documentation/cli/dart-sass/

Demo

This content is used generated CSS from SASS.

.. container:: sass-demo-bulma-content

   This paragraph is colored by "purplel".
docs/_sass/demo.scss
@use "bulma/sass/utilities/extends";

.sass-demo-bulma-content {
  @extend %control;
  background-color: purple;
  color: white;
}

Result:

This paragraph is colored by “purplel”.

Refs