Skip to content
pubscout

sass_builder

2.4.1, released 4 weeks ago by dartcommunity.dev

Transpile Sass files to CSS using Dart's build system.

$ flutter pub add sass_builder
Source repository

What it does

It compiles .scss/.sass files into .css, supports source maps, compressed output, and custom Sass options. It also provides a read-string function to load assets as strings or data URLs.

AI-written summary of version 2.4.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to compile Sass in a Dart/Flutter web or jaspr project
  • You want build_runner integration for automated asset generation

Skip it when

  • You are not using build_runner or a Dart web project
  • You need a runtime Sass compiler rather than a build step

Strengths

  • Build system integration
  • Configurable output style and source maps
  • Supports Sass deprecation controls
  • Built-in asset loading function

Weaknesses

  • Only works with build_runner
  • No runtime Sass support
  • Requires Dart 3.6+

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
7

Add dev:build_runner and dev:sass_builder, then run dart run build_runner build

dart pub add dev:build_runner dev:sass_builder
// web/main.scss
.a{color:blue;}
// run
dart run build_runner build

Alternatives

Packages that do the same job and could replace sass_builder.

  • peanut

    Update your GitHub gh-pages branch with compiled Dart web app output.

  • dartle

    A Dart-based task runner and build system for defining and executing tasks.

  • flutter_olm

    Builds the native Olm library for Android and iOS to be used via dart:ffi.

Works with

Packages commonly used together with sass_builder: ones it builds on, ones built on it, and its own family.