grind sasstask instead
1. Install Sass and add it to your path.
2. Add the following lines to your
dependencies: sass_transformer: any transformers: - sass_transformer
After adding the transformer, all your
.scss files that don't begin with
_ will be automatically transformed to
If your main file imports other files outside the main files folder, you need to add the option
sass know which folder will be used for processing outside imports:
dependencies: sass_transformer: any transformers: - sass_transformer: include_paths: path/to/folder/with/other/scss
you can have multiple
dependencies: sass_transformer: any transformers: - sass_transformer: include_paths: - path/to/folder/with/other/scss1 - path/to/folder/with/other/scss2
pub serveduring development, css files are going to live in memory only. Executing
pub buildcreates actual css files in build folder
3. Finally in the html files you only need to import the generated css files:
<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="path/to/main.css"> </head> <body> <!-- content goes hear --> </body> </html>
You can also pass options to Sass if necessary:
transformers: - sass_transformer: executable: /path/to/sass # Sass executable to use compass: true # Include compass line_numbers: true # Include line numbers in output style: compact # Style of generated CSS copy_sources: true # Copy original .scss/.sass files to output directory
You can use SassC instead of normal Sass by specifying executable as 'sassc' (or any path ending with 'sassc'):
transformers: - sass_transformer: executable: sassc # or /path/to/sassc
SassC only supports
.scss-files and does not support Compass.
libpath replacement. If primary asset path was
lib/without sub folder was not processed correctly.
Add this to your package's pubspec.yaml file:
dependencies: sass_transformer: "^0.1.2+1"
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:sass_transformer/sass.dart'; import 'package:sass_transformer/transformer.dart';
|0.1.2+1||Dec 2, 2016|
|0.1.2||Sep 1, 2016|
|0.1.1||Aug 27, 2016|
|0.1.0+1||Aug 26, 2016|
|0.1.0||Aug 26, 2016|
We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Detected platforms: Flutter, other
Platform components identified in package:
Package is getting outdated.
The package was released 79 weeks ago.
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:
example.dartor you could also use
Fix analysis and formatting issues.
Analysis or formatting checks reported 3 hints.
Similar analysis of the following files failed: