Skip to main content

SCSS compiler for lektor

PyPI version Downloads Upload Python Package Linting Python package

SCSS compiler for Lektor that compiles css from sass.

How does it actually work?

  • It uses libsass
  • It looks for .scss and .sass files (ignores part files that begin with a underscore e.g. '_testfile.scss') and compiles them as part of the build process.
  • It only rebuilds the css when it's needed (file changed, a file it imports changed or the config changed).
  • When starting the the development server it watches the files for changes in the background and rebuilds them when needed.

Installation

You can install the plugin with Lektor's installer:

lektor plugins add lektor-scss

Or by hand, adding the plugin to the packages section in your lektorproject file:

[packages]
lektor-scss = 1.5.1

Usage

To enable the plugin, pass the scss flag when starting the development server or when running a build:

# build and compile css from scss
lektor build -f scss

# edit site with new generated css
lektor server -f scss

Python3

It is highly recommended to use this plugin with a python3 version of lektor.

Since lektor can be used as a python module it is possible to enforce this (after lektor is installed eg. with pip3 install --user --upgrade lektor) with the following command:

# run a python3 lektor server with new generated css
python3 -m lektor server -f scss

Configuration

The Plugin has the following settings you can adjust to your needs:

parameter default value description
source_dir assets/scss/ the directory in which the plugin searchs for sass files (subdirectories are included)
output_dir assets/css/ the directory the compiled css files get place at
output_style compressed coding style of the compiled result. choose one of: 'nested', 'expanded', 'compact', 'compressed'
source_comments False whether to add comments about source lines
precision 5 precision for numbers
include_paths If you want to include SASS libraries from a different directory, libsass's compile function has a parameter called include_paths to add those directories to the search path.
use_compile_flag True If True the flag '-scss' is needed. Otherwise not.

An example file with the default config can be found at configs/scss.ini. For every parameter that is not specified in the config file the default value is used by the plugin.

Development

To test and/or develop on this plugin in your running lektor installation, simply place it in the packages/ Folder and have a look at the Lektor Doku

Metadata

Release files for lektor-scss 1.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lektor-scss 1.5.1
File Size Uploaded Provenance
lektor_scss-1.5.1.tar.gz 5.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lektor-scss 1.5.1
File Interpreter ABI Platform
lektor_scss-1.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / lektor_scss-1.5.1.tar.gz

Download URL lektor_scss-1.5.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
938332b34eaded73481276dd2bf38e02a8af2d92c11fb15e839d0f1695fdecbb
BLAKE2b-256 checksum
How to use checksums
f508e68576d026a40b42cf64282fa8d349d41577b2b735b3693e36e5162f83a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / lektor_scss-1.5.1-py3-none-any.whl

Download URL lektor_scss-1.5.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
543403bd9491b536b0869942069fdd24a913d2c7f8d7c7d6d9a2bdc4b3bae636
BLAKE2b-256 checksum
How to use checksums
708959dbb89519f46d333cac5e45e5e4d5b110622c3f99fc4491b93781eef4a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for lektor-scss 1.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page