sass_builder 2.1.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 95

sass_builder

Build Status

Transpile sass files using the build package and the dart implementation of sass.

Attention: Transformer has been removed in v2.0.0.

The transformer provided by this package has been removed. The pub build and pub serve commands have been replaced by build_runner in version 2.0.0-dev.51.0 of the Dart SDK.

Usage

1. Create a pubspec.yaml file containing the following code:

dependencies:
    # update to the latest version
    bootstrap_sass: any
dev_dependencies:
    # update to the latest version
    sass_builder: ^2.0.0
    build_runner: ^0.8.8

2. Create web/main.scss containing the following code:

@import "sub";
@import "package:bootstrap_sass/scss/variables";

.a {
  color: blue;
}

.c {
  color: $body-color;
}

3. Create web/_sub.scss containing the following code:

.b {
  color: red;
}

4. Create web/index.html containing the following code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Sample</title>
    <link rel="stylesheet" href="main.css">
</head>
<body>
<div class="a">Some Text</div>
<div class="b">Some Text</div>
<div class="c">Some Text</div>
</body>
</html>

5. Run pub run build_runner serve and then go to localhost:8080 with a browser and check if the file web/main.css was generated containing:

.b {
  color: red;
}

.a {
  color: blue;
}

.c {
  color: #373a3c;
}

Builder Options

To configure options for the builder see the build_config README.

  • outputStyle: Supports expanded or compressed. Defaults to expanded in dev mode, and compressed in release mode.

Example that compresses output in dev mode:

targets:
  $default:
    builders:
      sass_builder:
        options:
          outputStyle: compressed

2.1.1

  • Set max SDK version to <3.0.0

2.1.0

  • Output style is now compressed by default for release builds.

2.0.3

  • Upgrade selected package dependencies.

2.0.2

  • Fix bug where compiling Dart package imports in Windows environment would fail.

2.0.1

  • Fix bug where .sass entrypoints were not being compiled with "indented" syntax.
  • Remove all temp file creation. Files are now imported using a custom AsyncImporter.

2.0.0

New Feature

  • Add a builder which will clean up .scss and .sass sources for --release builds.

Breaking Change

  • Remove the pub transformer.

1.2.0

  • Add option to configure output style. Supports expanded or compressed as provided by the Dart implementation of Sass. Defaults to expanded.
  • Removed dev dependencies that were no longer used.

1.1.5

  • Fix a bug where the class Logger conflicted with sass, causing a crash.

1.1.4

  • Improve warning message when an imported file can not be found.

1.1.3

  • Fix example and documentation
  • Fix import sass files (fix #25)

1.1.2

  • Widen build and build_test dependencies.
  • Update example and add some instructions regarding build_runner.

1.1.1

  • Fixed compatibility with .sass file compilation.
  • Bump sass dependency to ^1.0.0-beta.4.

1.1.0

  • Support the latest version of build_runner.
  • Align the logger name with the package name: sass_builder.
  • Upgrade to build to ^0.11.1.

1.0.1

  • Support the latest version of build_runner.
  • Align the logger name with the package name: sass_builder.
  • Upgrade to build to ^0.10.2+1.

1.0.0

  • Write assets to temporary directory.

0.2.0

  • Upgrade build_runner to version ^0.4.0.

0.1.2

  • Fix #2: keep trying to build removed .scss.

0.1.1

  • Add missing import.

0.1.0

  • Upgrade build to ^0.9.1 and build_runner to ^0.3.2.

0.0.2

  • Recompile main files after editing sub files.

0.0.1

  • First version.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sass_builder: ^2.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sass_builder/sass_builder.dart';
  
Version Uploaded Documentation Archive
2.1.1 Jul 17, 2018 Go to the documentation of sass_builder 2.1.1 Download sass_builder 2.1.1 archive
2.1.0 Jul 2, 2018 Go to the documentation of sass_builder 2.1.0 Download sass_builder 2.1.0 archive
2.0.3 Jun 21, 2018 Go to the documentation of sass_builder 2.0.3 Download sass_builder 2.0.3 archive
2.0.2 Jun 14, 2018 Go to the documentation of sass_builder 2.0.2 Download sass_builder 2.0.2 archive
2.0.1 Jun 6, 2018 Go to the documentation of sass_builder 2.0.1 Download sass_builder 2.0.1 archive
2.0.0 May 3, 2018 Go to the documentation of sass_builder 2.0.0 Download sass_builder 2.0.0 archive
1.2.0 Apr 12, 2018 Go to the documentation of sass_builder 1.2.0 Download sass_builder 1.2.0 archive
1.1.5 Mar 19, 2018 Go to the documentation of sass_builder 1.1.5 Download sass_builder 1.1.5 archive
1.1.4 Feb 16, 2018 Go to the documentation of sass_builder 1.1.4 Download sass_builder 1.1.4 archive
1.1.3 Feb 12, 2018 Go to the documentation of sass_builder 1.1.3 Download sass_builder 1.1.3 archive

All 23 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
91
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
95
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, other

Primary library: package:sass_builder/sass_builder.dart with components: io, isolate, build.

Suggestions

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use sass_builder.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.51 <3.0.0
build ^0.12.5 0.12.7+3
build_config ^0.3.0 0.3.1+2
path ^1.4.1 1.6.2
sass ^1.5.0 1.10.4
Transitive dependencies
analyzer 0.32.4
args 1.5.0
async 2.0.8
charcode 1.1.2
cli_repl 0.2.0+1
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.4+1
front_end 0.1.4
glob 1.1.7
html 0.13.3+2
http 0.11.3+17
http_parser 3.1.3
js 0.6.1+1
json_annotation 1.1.0
kernel 0.3.4
logging 0.11.3+2
matcher 0.12.4
meta 1.1.6
package_config 1.0.5
package_resolver 1.0.4
plugin 0.2.0+3
pub_semver 1.4.2
pubspec_parse 0.1.2+2
quiver 2.0.0+1
source_maps 0.10.7
source_span 1.4.1
stack_trace 1.9.3
stream_transform 0.0.14+1
string_scanner 1.0.3
tuple 1.0.2
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_test ^0.10.2
test ^1.0.0