transform_sass 0.3.1

  • README.md
  • Installing
  • Versions
  • 86

Transform Sass

Join the chat at https://gitter.im/transform-sass/Lobby

Transform Sass is a Dart transformer for pub serve and pub build that uses [Dart-Sass][https://github.com/sass/dart-sass] for compiling scss and sass files into css. Transformer supports 'package:...' imports. This transformer can handle:

  • base_project/

    • pubspec.yaml
    • lib/
      • _base_style.scss
      • more/
        • _more_base_style.scss
        • _even_more_base_style.scss
  • another_project/

    • pubspec.yaml
    • lib/
      • _another_style.scss
  • your_project/

    • pubspec.yaml
    • lib/
      • _your_style.scss
    • web/
      • css/
        • style.scss
        • more/
          • _more_style.scss

Where the contents are as follows:

All pubspec.yaml files.

...
dependencies:
  ...
  transform_sass: '>=0.3.1'

transformers:
  ...
  - transform_sass
...

_base_style.scss

@import 'package:base_project/more/more_base_style';
@import 'more/even_more_base_style';
...

_another_style.scss

@import 'package:base_project/base_style';
...

_your_style.scss

@import 'package:base_project/base_style';
...

style.css

@import 'more/more_style';
@import 'package:your_project/another_style';
@import 'package:base_project/base_style'; // Redundant, but present for example
...

Simply put, all imports work like Dart. To use the transformer, add the following two lines to your pubspec.yaml file:

dependencies:
  transform_sass: '>=0.3.1'
transformers:
  - transform_sass

Afterwards, run pub install. Changes to the CSS in the browser only require refreshing the browser when running pub serve.

  • Source code is available at: https://github.com/halverneus/transform-sass
  • Pub is available at: https://pub.dartlang.org/packages/transform_sass

1. Depend on it

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


dependencies:
  transform_sass: "^0.3.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 packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:transform_sass/transform_sass.dart';
        
Version Uploaded Documentation Archive
0.3.1 Aug 26, 2017 Go to the documentation of transform_sass 0.3.1 Download transform_sass 0.3.1 archive
0.3.0 Aug 5, 2017 Go to the documentation of transform_sass 0.3.0 Download transform_sass 0.3.0 archive
0.2.4 Jun 20, 2017 Go to the documentation of transform_sass 0.2.4 Download transform_sass 0.2.4 archive
0.2.3 Jun 7, 2017 Go to the documentation of transform_sass 0.2.3 Download transform_sass 0.2.3 archive
0.1.0 Apr 2, 2017 Go to the documentation of transform_sass 0.1.0 Download transform_sass 0.1.0 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
81 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80 / 100
Overall score:
Weighted score of the above. [more]
86

Platforms

Detected platforms: Flutter, other

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

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use transform_sass.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <2.0.0
barback ^0.15.2 0.15.2+14
package_resolver ^1.0.2 1.0.2
path ^1.4.1 1.5.1
sass ^1.0.0-beta.2 1.0.0-beta.5.1
Transitive dependencies
args 1.3.0
async 2.0.3
charcode 1.1.1
collection 1.14.5
convert 2.0.1
http 0.11.3+16
http_parser 3.1.1
meta 1.1.2
package_config 1.0.3
pool 1.3.4
quiver_hashcode 1.0.0
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
tuple 1.0.1
typed_data 1.1.5