Commit Graph

832 Commits

Author SHA1 Message Date
Natalie Weizenbaum
55ebe56d3c
Add support for new special number strings (#556)
See sass/sass#2584
2019-01-09 15:50:04 -05:00
Natalie Weizenbaum
32be730b6e
Emit tab characters as \9 (#553)
Closes #552
2019-01-04 14:20:28 -05:00
Natalie Weizenbaum
7a75b7b786
Don't canonicalize file case in source maps (#541)
Closes #540
2019-01-04 14:17:18 -05:00
Nicholas Shahan
948fe17a53
Remove unused import (#559)
Originally added in #548 but after changes during review it is no longer needed.
2019-01-03 15:36:05 -08:00
Natalie Weizenbaum
18c0cbdaea
Match Node Sass's this.includePaths behavior for importers (#551)
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2019-01-03 10:48:20 -08:00
Natalie Weizenbaum
759b587364
Don't omit units in numbers in compressed mode (#545)
See https://github.com/sass/sass/issues/649#issuecomment-447033060
2019-01-03 10:47:54 -08:00
Natalie Weizenbaum
dbda396401
Compile to JS with -O4 (#555)
Closes #526
2019-01-03 10:47:12 -08:00
Natalie Weizenbaum
06b9fbd812
Merge branch 'master' into windows-path-separator 2018-12-26 14:17:45 -08:00
Natalie Weizenbaum
9f2f11682e
Merge pull request #546 from sass/source-map-urls
Properly use ImportResult.sourceMapUrl for source map URLs
2018-12-20 17:39:28 -08:00
Natalie Weizenbaum
23968148d0 Properly use ImportResult.sourceMapUrl for source map URLs
This also uses data: URLs to refer to stylesheets from stdin in source
maps.
2018-12-20 16:22:43 -08:00
Nicholas Shahan
3a493f23ab
Add documentation comment collection to AST (#548)
- Documentation comments are simply identified by starting with a triple-slash "///". 
- Adjacent comments in indented syntax are now coalesced into a single comment.
2018-12-20 16:08:26 -08:00
Natalie Weizenbaum
9d6de5af23 Add a missing import 2018-12-17 15:52:49 -08:00
Natalie Weizenbaum
519bfa3d6b Match Node Sass's this.includePaths behavior for importers
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2018-12-17 15:30:17 -08:00
Natalie Weizenbaum
94fd7e6e50
Match Ruby Sass's number behavior (#544)
This introduces two changes:

1. It changes the epsilon within which two numbers are considered
   equal to be an order of magnitude smaller than the numeric
   precision. Ruby Sass has always done this, and Dart Sass should
   have but did not until now.

2. It parses the component of a number after the decimal point using
   double.parse() to avoid accumulating floating point errors.
2018-12-13 15:27:08 -08:00
Natalie Weizenbaum
fa29e80d29
Merge pull request #542 from sass/compile-refactor
Move some compilation logic from the executable to compile.dart
2018-12-13 11:58:46 -08:00
Natalie Weizenbaum
a09a62538e Remove extra importer parameters from internal compile functions
These can be passed as an ImportCache now, so they make the API more
confusing for relatively little benefit.

This also changes the const AsyncImportCache.none field to a non-const
AsyncImportCache.none() constructor. The const field didn't make sense
for a couple reasons: first, it wouldn't use a user's custom logger;
and second, it couldn't cache any relative imports, which were still
possible when the initial file was loaded from disk.
2018-12-12 15:54:32 -08:00
Natalie Weizenbaum
4c2d3af3b0 Move some compilation logic from the executable to compile.dart 2018-12-11 00:12:27 -08:00
Natalie Weizenbaum
56247975ed Automatically synchronize lib/src/compile.dart 2018-12-10 17:39:21 -08:00
Natalie Weizenbaum
f3db1d6a66
Properly merge "all and" media queries (#539)
Closes #537
2018-12-10 13:13:19 -08:00
Natalie Weizenbaum
dad8491035
Make types.String.prototype.setValue() de-quote a string (#535)
Closes #513
2018-12-06 15:06:32 -08:00
Natalie Weizenbaum
aa52cf1474
Always add quotes to attribute selector values that begin with -- (#529)
Closes #527
2018-11-16 13:51:36 -08:00
Natalie Weizenbaum
487e5025ff Reformat with Dart-2-only features 2018-11-15 15:16:24 -08:00
Natalie Weizenbaum
50efdabcce Add support for CSS Color Level 4 rgb() and hsl() syntax
Closes #497
2018-11-12 16:33:54 -08:00
Natalie Weizenbaum
e0c328576b Track slash-separated numbers as numbers rather than strings
This will allow us to refer to them as numbers in functions that use
the slash as an argument separator.
2018-11-12 14:49:24 -08:00
Natalie Weizenbaum
13006e9902
Clamp saturation and lightness rather than throwing errors (#521)
This matches Ruby Sass's behavior.
2018-11-12 14:25:40 -08:00
Natalie Weizenbaum
4520b8b53b
Don't trim escaped whitespace (#523)
Related to sass/ruby-sass#96
2018-11-08 11:54:59 -08:00
Natalie Weizenbaum
1206761da4
Add support for passing arguments to @content blocks (#518)
Closes #498
2018-11-05 16:53:43 -08:00
Natalie Weizenbaum
8f86d6d157
Remove the ignoreCase flag from scanIdentifier and expectIdentifier (#517)
This flag wasn't being respected, so all of these identifiers were de
facto case-insensitive. Changing that now would be breaking, and it's
probably better to make them case-insensitive anyway since CSS
identifiers are.
2018-11-05 16:28:10 -08:00
Natalie Weizenbaum
77563be056
Add support for SASS_PATH (#514)
Closes #512
2018-11-05 15:24:14 -08:00
Natalie Weizenbaum
e0c1895712
Make sure RecursiveStatementVisitor visits AtRule.name (#516)
I missed this as part of #509. It doesn't actually cause any problems,
because we don't use the expression-visiting functionality, but it
could cause issues for the linter.
2018-11-05 15:23:58 -08:00
Natalie Weizenbaum
bf71ca359d
Add support for interpolation in at-rule names (#509)
Closes #496
2018-11-01 14:31:46 -07:00
Natalie Weizenbaum
9e18b7e95b
Always include the error location in JS error messages (#511)
Always include the error location in JS error messages

I was trying to match Node Sass's behavior by having Error.formatted
property have more detail than Error.message, but our errors rely on
source snippets for context so this just ended up making them
confusing.
2018-10-31 18:13:04 -07:00
Natalie Weizenbaum
de1fcfbbe3
Fix a minor style guide violation (#508) 2018-10-31 18:12:49 -07:00
Natalie Weizenbaum
6bdb49a9d5
Properly escape U+0009 CHARACTER TABULATION in unquoted strings (#504) 2018-10-18 18:50:03 -07:00
Natalie Weizenbaum
a25bbb3fc7
Add a ParenthesizedExpression class (#503)
This allows us to accurately track the source spans for parenthesized
expressions, which in turn allows us to print accurate error
indications.

Adding a new class for this more accurately represents the structure
of the expression, but it also involves an extra allocation during
parsing and an extra level of nesting during evaluation which could
have a small but real performance impact.

We could alternatively add a package-internal setter for
Expression.span, and update the source span for parenthesized
expressions after they're initially parsed. However, this has its own
downsides: it adds complexity and mutability to the object model; and
many expression classes currently use lazily-generated spans, so
making them settable would require adding extra slots on those
classes.

I decided to go with the extra class because it only adds overhead
when parentheses are actually used in practice, as opposed to adding
overhead to every list/color/etc. The runtime overhead is also likely
to be mitigated if at any point we add a constant-folding step.
2018-10-17 16:52:32 -07:00
Natalie Weizenbaum
96468e4fa5
Fix a small documentation typo (#499) 2018-10-15 15:53:48 -07:00
Natalie Weizenbaum
453d89bad5
Treat :before et al a pseudo-elements (#495)
Closes #484
2018-10-12 14:35:49 -07:00
Jen Thakar
9a1f322d7f Remove space around combinators in compressed mode (#494)
Complex selectors like "a > b" will now be output as "a>b" in
compressed mode.
2018-10-11 18:03:09 -07:00
Natalie Weizenbaum
0595ac3e71
Fix an import-resolution bug (#488)
When a stylesheet is imported, the parsed stylesheet object is cached
based on its canonical URL. However, the stylesheet.span.sourceUrl was
based on the text of the import that was used to load that stylesheet.
The idea was to make the source URL in stack traces look nicer, but it
meant that relative URLs could be resolved based on the old importer's
URL before being sent to the new importer, which caused bugs.

Now stylesheet.span.sourceUrl is always the canonical URL of the
stylesheet, and thus safe to cache. We then use the import cache to
convert the canonical URL to a human-friendly URL at the point at
which we generate stack traces.

This also deprecates support for relative canonical URLs. The
semantics of these URLs were always unclear, and with the new change
in import internals the old behavior doesn't make much sense. It's
preserved for backwards-compatibility, but deprecated.
2018-10-11 15:06:26 -07:00
Natalie Weizenbaum
123bc1ff68
Properly escape U+001F INFORMATION SEPARATOR ONE in unquoted strings (#487)
See sass/sass-spec#1288
2018-10-10 15:49:43 -07:00
Natalie Weizenbaum
0620ccc19a
Fix @debug on stdin (#493) 2018-10-10 15:05:23 -07:00
Natalie Weizenbaum
ff3cea5312
Properly parse escaped digits at the beginning of identifiers (#486)
See sass/sass#1542
Closes sass/dart-sass#485
2018-09-26 21:01:46 -04:00
Natalie Weizenbaum
b3c9e7b00f
Fix a parsing bug involving nested content blocks (#483)
Closes #482
2018-09-26 14:32:55 -04:00
Progracientist
a6164217df Prettify URIs (#481)
Closes #464
2018-09-26 13:39:49 -04:00
Natalie Weizenbaum
89b86be5e8
Enable full alpha hex support (#478)
Closes #371
2018-09-19 16:03:32 -04:00
Natalie Weizenbaum
1a5eb2a2e3
Fix embedding source maps with non-ASCII characters (#471)
Closes #457
2018-09-11 12:13:43 -07:00
Natalie Weizenbaum
ede9c81e0b
Properly adjust source maps when prepending encoding information (#470)
Closes #469
2018-09-10 15:38:30 -07:00
Natalie Weizenbaum
edf3370cd9
Parse :nth-child() selectors with extra whitespace (#467)
As a side effect of the new parse, this also removes extra whitespace
from :nth-child() selectors.

Closes #465
2018-09-05 15:28:26 -07:00
Natalie Weizenbaum
048b17495e
Support browser hacks in plain CSS mode (#468)
Closes #466
2018-09-05 14:31:59 -07:00
Natalie Weizenbaum
9e5ef91f22
Add support for the single-equals operator in plain CSS (#463)
Closes #462
2018-08-31 18:15:23 -06:00