GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - attakei/sass-embedded-python: Python Sass binding using Dart Sass

BranchesTags
Open more actions menu

Latest commit

 

History

308 Commits
308 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.github
.github
 
 
docs
docs
 
 
examples
examples
 
 
src/sass_embedded
src/sass_embedded
 
 
tests
tests
 
 
tools
tools
 
 
.age.toml
.age.toml
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.python-version
.python-version
 
 
.readthedocs.yaml
.readthedocs.yaml
 
 
CHANGES.rst
CHANGES.rst
 
 
README.rst
README.rst
 
 
Taskfile.yaml
Taskfile.yaml
 
 
aqua.yaml
aqua.yaml
 
 
biome.json
biome.json
 
 
create_protobuf.py
create_protobuf.py
 
 
hatch_build.py
hatch_build.py
 
 
lefthook.yaml
lefthook.yaml
 
 
pyproject.toml
pyproject.toml
 
 
renovate.json5
renovate.json5
 
 
uv.lock
uv.lock
 
 

Repository files navigation

sass-embedded-python

Embedded Sass Host for Python.

Important

This is laboratory stage project. It does not ensure to continue development for goal.

Overview

This is Python project to compile Sass/SCSS using Dart Sass <https://sass-lang.com/dart-sass/> that is primary implementation of Sass using Dart runtime.

Simple usage

Install:

pip install sass-embedded

Source:

@use "sass:list";
@use "sass:color";

$font-stack: Helvetica, Arial;
$primary-color: #333;

body {
  $font-stack: list.append($font-stack, sans-serif);
  font: $font-stack;
}

a {
  color: $primary-color;

  &:hover{
    color: color.scale($primary-color, $lightness: 20%);
  }
}

@debug $font-stack;

Run:

from pathlib import Path
from sass_embedded import compile_file

compile_file(Path("style.scss"))

Output:

body {
  font: Helvetica, Arial, sans-serif;
}

a {
  color: #333;
}
a:hover {
  color: rgb(91.8, 91.8, 91.8);
}

Motivation

I develop sphinx-revealjs that is Python Project to generate HTML presentation from reStructuredText or Markdown.

Reveal.js uses Sass to create presentation themes, and this uses sass:color module since v5.2.0. But sphinxcontrib-sass does not compile themes, because this module is not supported by LibSass.

To resolve it, I am developing optional extension optimized sphinx-revealjs. Concurrently I will develop generic project for multiple usecases.

This is the side of "generic project".

Project goal

Final goal is to have features as same as other "Sass Embedded" libraries.

But I will split some steps for it.

First goal

Works as compile Sass/SCSS with subprocess-based actions.

  • Provide single entrypoint to compile sources using Dart Sass native executable.
  • Generate Dart Sass bundled bdist files every platforms.

Second goal

Works as "Sass Embedded Host for Python".

  • Support The Embedded Sass Protocol.

Third goal

Works as alternative to libsass-python.

  • Support all api of libsass-python using Dart Sass native executable.

Support

This project supports only Python 3.10+.

License

I plan for Apache License 2.0.

About

Python Sass binding using Dart Sass

Topics

dart-sassdart-sass-embeddedpythonsass

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.