sass4dart 0.0.9-9.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 45

A Dart implementation of Sass specifically for Dart. Sass makes CSS fun again in Dart. This is the dart-sass source code with a patch applied that permits users to place their scss/sass files in the /lib folder and import them using 'package:', just like Dart. This also works on third-party source code.

Using Sass4Dart

There are a few different ways to install and run Dart Sass, depending on your environment and your needs.

From Pub

If you're a Dart user, you can install Dart Sass globally using pub global activate sass ^0.0.9, which will provide a sass4dart executable.

From Source

Assuming you've already checked out this repository:

  1. 'git checkout sass4dart/release'

  2. Install Dart. If you download it manually, make sure the SDK's bin directory is on your PATH.

  3. In this repository, run pub get. This will install Sass4Dart's dependencies.

  4. 'cd' into the directory containing the '.packages' file.

  5. Run dart path/to/sass4dart/bin/sass4dart.dart path/to/file.scss.

1.0.0-alpha.9

  • Elements without a namespace (such as div) are no longer unified with elements with the empty namespace (such as |div). This unification didn't match the results returned by is-superselector(), and was not guaranteed to be valid.

  • Support & within @at-root.

  • Properly error when a compound selector is followed immediately by &.

  • Properly handle variable scoping in @at-root and nested properties.

  • Properly handle placeholder selectors in selector pseudos.

  • Properly short-circuit the or and and operators.

  • Support --$variable.

  • Don't consider unitless numbers equal to numbers with units.

  • Warn about using named colors in interpolation.

  • Don't emit loud comments in functions.

  • Detect import loops.

  • Fix @import with a supports() clause.

  • Forbid functions named "and", "or", and "not".

  • Fix type-of() with a function.

  • Emit a nicer error for invalid tokens in a selector.

  • Fix invert() with a $weight parameter.

  • Fix a unit-parsing edge-cases.

  • Always parse imports with queries as plain CSS imports.

  • Support & followed by a non-identifier.

  • Properly handle split media queries.

  • Properly handle a placeholder selector that isn't at the beginning of a compound selector.

  • Fix more str-slice() bugs.

  • Fix the % operator.

  • Allow whitespace between = and the mixin name in the indented syntax.

  • Fix some slash division edge cases.

  • Fix not when used like a function.

  • Fix attribute selectors with single-character values.

  • Fix some bugs with the call() function.

  • Properly handle a backslash followed by a CRLF sequence in a quoted string.

  • Fix numbers divided by colors.

  • Support slash-separated numbers in arguments to plain CSS functions.

  • Error out if a function is passed an unknown named parameter.

  • Improve the speed of loading large files on Node.

  • Don't consider browser-prefixed selector pseudos to be superselectors of differently- or non-prefixed selector pseudos with the same base name.

  • Fix an @extend edge case involving multiple combinators in a row.

  • Fix a bug where a @content block could get incorrectly passed to a mixin.

  • Properly isolate the lexical environments of different calls to the same mixin and function.

1.0.0-alpha.8

  • Add the content-exists() function.

  • Support interpolation in loud comments.

  • Fix a bug where even valid semicolons and exclamation marks in custom property values were disallowed.

  • Disallow invalid function names.

  • Disallow extending across media queries.

  • Properly parse whitespace after ... in argument declaration lists.

  • Support terse mixin syntax in the indented syntax.

  • Fix @at-root query parsing.

  • Support special functions in @-moz-document.

  • Support ... after a digit.

  • Fix some bugs when treating a map as a list of pairs.

1.0.0-alpha.7

  • Fix function-exists(), variable-exists(), and mixin-exists() to use the lexical scope rather than always using the global scope.

  • str-index() now correctly inserts at negative indices.

  • Properly parse url()s that contain comment-like text.

  • Fix a few more small @extend bugs.

  • Fix a bug where interpolation in a quoted string was being dropped in some circumstances.

  • Properly handle @for rules where each bound has a different unit.

  • Forbid mixins and functions from being defined in control directives.

  • Fix a superselector-computation edge case involving :not().

  • Gracefully handle input files that are invalid UTF-8.

  • Print a Sass stack trace when a file fails to load.

1.0.0-alpha.6

  • Allow var() to be passed to rgb(), rgba(), hsl(), and hsla().

  • Fix conversions between numbers with dpi, dpcm, and dppx units. Previously these conversions were inverted.

  • Don't crash when calling str-slice() with an $end-at index lower than the $start-at index.

  • str-slice() now correctly returns "" when $end-at is negative and points before the beginning of the string.

  • Interpolation in quoted strings now properly preserves newlines.

  • Don't crash when passing only $hue or no keyword arguments to adjust-color(), scale-color(), or change-color().

  • Preserve escapes in identifiers. This used to only work for identifiers in SassScript.

  • Fix a few small @extend bugs.

1.0.0-alpha.5

  • Fix bounds-checking for opacify(), fade-in(), transparentize(), and fade-out().

  • Fix a bug with @extend superselector calculations.

  • Fix some cases where #{...}-- would fail to parse in selectors.

  • Allow a single number to be passed to saturate() for use in filter contexts.

  • Fix a bug where **/ would fail to close a loud comment.

  • Fix a bug where mixin and function calls could set variables incorrectly.

  • Move plain CSS @imports to the top of the document.

1.0.0-alpha.4

  • Add support for bracketed lists.

  • Add support for Unicode ranges.

  • Add support for the Microsoft-style = operator.

  • Print the filename for @debug rules.

  • Fix a bug where 1 + - 2 and similar constructs would crash the parser.

  • Fix a bug where @extend produced the wrong result when used with selector combinators.

  • Fix a bug where placeholder selectors were not allowed to be unified.

  • Fix the mixin-exists() function.

  • Fix :nth-child() and :nth-last-child() parsing when they contain of selector.

1.0.0-alpha.3

  • Fix a bug where color equality didn't take the alpha channel into account.

  • Fix a bug with converting some RGB colors to HSL.

  • Fix a parent selector resolution bug.

  • Properly declare the arguments for opacify() and related functions.

  • Add a missing dependency on the stack_trace package.

  • Fix broken Windows archives.

  • Emit colors using their original representation if possible.

  • Emit colors without an original representation as names if possible.

1.0.0-alpha.2

  • Fix a bug where variables, functions, and mixins were broken in imported files.

1.0.0-alpha.1

  • Initial alpha release.

1. Depend on it

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


dependencies:
  sass4dart: "^0.0.9-9.4"

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:sass4dart/sass4dart.dart';
        
Version Uploaded Documentation Archive
0.0.9-9.4 Mar 22, 2017 Go to the documentation of sass4dart 0.0.9-9.4 Download sass4dart 0.0.9-9.4 archive

Analysis

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

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

  • tool failures on Feb 16, 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]
0 / 100
Health:
Code health derived from static analysis. [more]
96 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
83 / 100
Overall score:
Weighted score of the above. [more]
45

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:sass4dart/sass4dart.dart.

Suggestions

  • Fix lib/src/node.dart.

    Strong-mode analysis of lib/src/node.dart failed with the following error:

    line: 5 col: 8
    Target of URI doesn't exist: 'package:js/js.dart'.

  • Fix lib/src/io/node.dart.

    Strong-mode analysis of lib/src/io/node.dart failed with the following error:

    line: 5 col: 8
    Target of URI doesn't exist: 'package:js/js.dart'.

  • Fix further 4 Dart files.

    Similar analysis of the following files failed:

    • lib/src/node/error.dart
    • lib/src/node/options.dart
    • lib/src/node/result.dart
    • lib/src/node/exports.dart
  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 3 error(s) and 0 warning(s).

  • Package is pre-release.

    Pre-release versions should be used with caution, their API may change in breaking ways.

  • 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.

  • 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 sass4dart.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0
args ^0.13.0 0.13.7 1.3.0
charcode ^1.1.0 1.1.1
collection ^1.8.0 1.14.5
package_resolver ^1.0.0 1.0.2
path ^1.0.0 1.5.1
source_span ^1.3.0 1.4.0
stack_trace >=0.9.0 <2.0.0 1.9.2
string_scanner >=0.1.5 <2.0.0 1.0.2
tuple ^1.0.0 1.0.1
Transitive dependencies
async 2.0.3 2.0.4
http_parser 3.1.1
package_config 1.0.3
quiver_hashcode 1.0.0
typed_data 1.1.5
Dev dependencies
archive ^1.0.0
dart_style ^0.2.9
grinder ^0.8.0
http ^0.11.0 0.11.3+16
js ^0.6.0
node_preamble ^1.1.0
scheduled_test ^0.12.8
test ^0.12.5
xml ^2.4.0
yaml ^2.0.0