Commit Graph

994 Commits

Author SHA1 Message Date
Awjin Ahn
3d1dab3563 Print call-site for @errors in mixins and functions (#878)
For any @errors encountered in mixins or functions, use the call-site
(instead of the @error rule) as the span printed in the error message.

Closes #474
See sass/sass-spec#1494
2019-11-13 17:56:35 -08:00
Nate Bosch
7b0faec321 Migrate to stream_transform extension methods
The non-extension implementation will be removed in the next version.

Bump the min SDK to 2.6.0 to reflect the fact that extension methods are
used.
2019-11-06 14:47:24 -08:00
Natalie Weizenbaum
20978e0320 Fix new strict inference hints from Dart 2.6 2019-11-06 14:47:24 -08:00
Natalie Weizenbaum
44059573bb
Watch files through @forward rules (#871)
Closes #870
2019-11-04 13:32:27 -08:00
Natalie Weizenbaum
be4ca60045 Propagate selector source specificity between modules
Closes #866
2019-10-30 15:11:25 -07:00
Natalie Weizenbaum
df5f3af4e9 Remove some unused specificity calculations 2019-10-30 14:23:55 -07:00
Natalie Weizenbaum
3392db0074
Don't compile .css files in directories to themselves (#862)
This also adds support for compiling .css files in directories *at
all*, which had previously only worked in --watch mode.

Closes #853
2019-10-29 23:48:21 +00:00
Natalie Weizenbaum
1b17ab76cf
Reset the forwarded config to empty for @use and meta.load-module() (#855)
In #827 I made configuration never be null, but this turns out to be
overkill: we still need a way for _loadModule() and _execute() to
distinguish between "use the existing configuration" (for @forward)
and "use no configuration" (for an unconfigured @use or
meta.load-module()). We now use null as a sentinel value there, while
still ensuring that _configuration is non-nullable.

Closes #854
2019-10-22 01:35:11 +01:00
Natalie Weizenbaum
73de08b817
Only generate and update selectors, not rules, in Extender (#856)
We switched to *updating* selectors a while ago so that cloned rules
would continue to see updates in their selectors, but we were still
generating and tracking rules in the Extender. This caused skew
between what rules the extender knew about and what rules actually
existed in situations where rules were copied (such as when resolving
nested media queries).

There's no principled reason the extender needs to know about style
rules at all, so now it just tracks modifiable wrappers of selectors.
These are re-used even when style rules are cloned, so they're safe
from the skew problem.

Closes #843
2019-10-21 21:07:51 +01:00
Natalie Weizenbaum
6b8c168779
Improve error messages for color functions that aren't in sass:color (#844) 2019-10-14 17:56:13 -07:00
Natalie Weizenbaum
e68592f8f3
Allow saturate() in plain CSS files (#845)
Closes #840
2019-10-14 11:47:16 -07:00
XhmikosR
a95d61e886 Typo fixes (#842) 2019-10-10 15:33:36 -07:00
Jennifer Thakar
c663995f50
Only error for directly configured core modules (#839)
Fixes #838.
2019-10-10 14:33:54 -07:00
Natalie Weizenbaum
97203f1527 Merge branch 'feature.use' 2019-10-01 14:26:32 -07:00
Natalie Weizenbaum
fa3c657b56
Support multiple global uses in one file (#833)
Closes #832
2019-09-27 21:36:37 +01:00
Natalie Weizenbaum
7d3440698f
Remove adjust-hue() from sass:color (#828)
See sass/sass#2740
2019-09-27 21:27:26 +01:00
Natalie Weizenbaum
75305a1d21
Always use a non-null map for _EvaluateVisitor._configuration (#827)
We had been using null to represent an empty configuration, but that
caused problems when an empty map snuck its way in as well. Now we
always use maps, with a const empty map for the common case.

See sass/sass#2744
2019-09-27 21:19:24 +01:00
Natalie Weizenbaum
93a3a6f9f3 Merge branch 'master' into feature.use 2019-09-24 17:20:39 +01:00
Jennifer Thakar
553cf9a6d5 Fix bugs in RecursiveStatementVisitor (#824)
`AtRootRule.query` and `Declaration.value` can be null, so this should be checked before passing them on to `visitInterpolation` and `visitExpression`.
2019-09-23 07:33:28 -07:00
Natalie Weizenbaum
d901bcb00c
Properly handle some CSS identifier edge cases (#816)
See sass/sass#2738
Closes #815
2019-09-06 16:54:54 -07:00
Natalie Weizenbaum
aea990d4fc
Properly watch .css files for changes (#814)
Closes #806
2019-09-03 16:42:21 -07:00
Natalie Weizenbaum
4ccddf8b13
Dash-normalize user-defined functions (#813)
Closes #811
2019-09-03 16:00:07 -07:00
Natalie Weizenbaum
35880d171f
Check fs.existsSync() before running fs.statSync() (#812)
This produces non-negligible speed improvements for Node users with
lots of imports.
2019-09-03 13:26:57 -07:00
Natalie Weizenbaum
75c0452c1d Merge branch 'master' into feature.use 2019-09-02 13:58:21 -07:00
Natalie Weizenbaum
8dea51d410
Change variable syntax to namespace.$name (#803)
See sass/sass#2731
2019-08-29 15:31:03 -07:00
Natalie Weizenbaum
a89c67b563
Fix unquoted plain-CSS imports (#800)
Closes #799
2019-08-28 14:09:35 -07:00
Natalie Weizenbaum
fc8c987fc1
Fix a few @extend edge cases (#797) 2019-08-16 14:00:14 -07:00
Natalie Weizenbaum
0e5ed4a37d
Fix dash-insensitivity in get-function() (#795)
Closes #792
2019-08-14 12:20:47 -07:00
Natalie Weizenbaum
5349042994
Allow @use in the REPL (#784) 2019-07-30 00:51:54 +01:00
Natalie Weizenbaum
6775490251 Merge remote-tracking branch 'origin/master' into merge-master 2019-07-25 17:15:27 -07:00
Natalie Weizenbaum
d840b84b59 Clarify the error for the wrong number of positional arguments
Closes #776
2019-07-25 08:37:01 +01:00
Natalie Weizenbaum
d408a5994e Add a missing trailing "." to an error message
Closes #775
2019-07-25 08:37:01 +01:00
Natalie Weizenbaum
382af499e0 Avoid double "Error:" headers when reporting selector parse errors
Closes #774
2019-07-25 08:37:01 +01:00
Natalie Weizenbaum
44b542fcef Include argument names when reporting selector parse errors 2019-07-25 08:37:01 +01:00
Natalie Weizenbaum
8d5e3d9a67 Include argument names when reporting range errors
Closes #771
2019-07-25 08:37:00 +01:00
Natalie Weizenbaum
c971615fbf
Remove an unused Parser.scanWhitespace() method (#770)
Closes #767
2019-07-18 21:50:41 +01:00
Natalie Weizenbaum
e454647d27
Improve the error message for a global member conflict (#762) 2019-07-18 01:47:56 +01:00
Natalie Weizenbaum
0f8f7577a5 Don't create an intermediate stylesheet for @import if possible
We really only need this stylesheet when we're resolving imported
cross-module @extends, which doesn't come up very often.
2019-07-17 15:45:26 -07:00
Natalie Weizenbaum
c8770da29b Short-circuit combineCSS() if no upstream modules contain CSS 2019-07-17 15:45:00 -07:00
Natalie Weizenbaum
66c2c26a7e Use whereType() to avoid a cast 2019-07-17 15:45:00 -07:00
Natalie Weizenbaum
7b3a2adc12 Properly indicate the error location in the REPL
Previously, errors in variable assignment lines would be reported
incorrectly.
2019-07-17 15:45:00 -07:00
Natalie Weizenbaum
83cf390406 Delete a fixed TODO 2019-07-17 15:45:00 -07:00
Natalie Weizenbaum
c794abd858 Eagerly dash-normalize Sass identifiers
This avoids using maps and sets with custom equality, which are
moderately inefficient relative to built-in maps and sets on both Node
and the Dart VM. In order to make error messages continue to use the
original identifiers where possible, this updates some of them to rely
more heavily on their associated source spans for context.
2019-07-16 19:42:38 -07:00
Natalie Weizenbaum
437e04ea0b Merge remote-tracking branch 'origin/master' into feature.use 2019-07-16 18:49:15 -07:00
Natalie Weizenbaum
7f2055e775 Make colorsByName a normal map
There was no reason for this to be a normalized map, since color names
don't contain dashes or underscores.
2019-07-16 13:37:03 -07:00
Marcel Greter
d91e758889 Fix typo in silent comment error message (#761) 2019-07-16 00:44:32 +01:00
Natalie Weizenbaum
58e9e74b37 Use list comprehensions in *Evaluate._evaluateArguments
As well as being arguably more readable, the toList() method was
running a type check that was showing up as a minor bottleneck in JS
profiles.
2019-07-15 21:59:54 +01:00
Natalie Weizenbaum
a8e99e9152 Pass a dummy isValidKey callback to normalized map and set
The default implementation runs a type check, which was a performance
bottleneck when compiled to JS. There's no need for this type check in
practice, since we never pass a non-String value to the contains(),
containsKey(), or remove() methods (and if we do, it will throw a
TypeError in our tests).
2019-07-15 21:59:54 +01:00
Natalie Weizenbaum
0e47e03305
Fix at-rules in nested imports (#758)
Closes #755
2019-07-12 01:55:30 +01:00
Natalie Weizenbaum
2003f1c6ec Merge remote-tracking branch 'origin/master' into function-fixes 2019-07-03 16:56:54 -07:00