Commit Graph

1208 Commits

Author SHA1 Message Date
Natalie Weizenbaum
fd1bfd293b
Fix the URL for the @-moz-document deprecation message (#1339)
Closes #1336
2021-06-01 18:07:46 -07:00
Rafer45
b098adb289
Improve wording of comment (#1331)
Avoid a triple negative ("aren't unless non-null")
2021-05-24 14:19:38 -07:00
Natalie Weizenbaum
16f181660c Only omit 5 deprecation warnings per feature by default (#1327)
Closes #1323
2021-05-21 22:45:58 -07:00
Natalie Weizenbaum
d660bf12ef Add an option to the CLI and Dart Sass to silence warnings from deps
Closes #672
2021-05-21 22:45:58 -07:00
Natalie Weizenbaum
7f982a1b3a
Only emit each warning once per source location (#1322) 2021-05-21 16:23:53 -07:00
Jennifer Thakar
efe680e74b
Make :is() behave like :matches() (#1315) 2021-05-20 14:13:10 -07:00
Natalie Weizenbaum
f33b934fe4
Fix some edge cases when serializing edge-case numbers (#1312)
Also pin static analysis to Dart 2.12 to work around dart-lang/sdk#45488.
2021-05-19 17:29:16 -07:00
Natalie Weizenbaum
47920ad032
Merge branch 'master' into slash-separator 2021-05-17 14:13:03 -07:00
Natalie Weizenbaum
818d0d1e44 Fix context.options.context 2021-05-13 19:19:08 -07:00
Natalie Weizenbaum
136bd285b3 Add AsyncImporter.fromImport for Dart importers 2021-05-13 18:06:43 -07:00
Natalie Weizenbaum
8a344e343f Add this.fromImport for JS importers
See sass/sass#3055
See webpack-contrib/sass-loader#905
2021-05-13 17:40:31 -07:00
Natalie Weizenbaum
114b460d7c Merge remote-tracking branch 'origin/master' into slash-separator 2021-05-13 16:43:52 -07:00
Natalie Weizenbaum
5a0242a090 Code review 2021-05-13 16:43:15 -07:00
Natalie Weizenbaum
68c4d6556e Make number arguments to built-in functions slash-free
See sass/sass#3050
2021-05-12 13:21:31 -07:00
Natalie Weizenbaum
be1a414f07 Deprecate /-as-division and add replacements
Partially addresses #663
2021-05-12 13:21:28 -07:00
Jennifer Thakar
5d4950db36
Fix bug with null values in configuration (#1305)
Fixes #1281.
2021-05-12 09:09:35 -07:00
Natalie Weizenbaum
742023a877 Always track variables' source spans
This is necessary for generating useful error messages for
/-as-division.
2021-05-11 13:24:20 -07:00
Christophe Coevoet
be2d3e848a
Fix argument names in str-slice errors (#1303) 2021-05-05 17:02:14 -07:00
Natalie Weizenbaum
574e76326e
Fix a couple doc comment typos (#1302) 2021-04-30 16:46:06 -07:00
Awjin Ahn
30ede40732
Fix extending selectors across multiple modules. (#1298)
* Fix extending selectors across multiple modules.

Allows more than one module to extend the same upstream selector that,
in turn, extends a selector from its upstream module.

Properly skips creating an extra extension that was being counted as
unresolved when evaluating @extends.

See https://github.com/sass/sass-spec/pull/1635
Fixes https://github.com/sass/dart-sass/issues/1295
2021-04-28 14:19:12 -07:00
Natalie Weizenbaum
45c1333276
Properly reset variables in the loop in _peekIndentation() (#1288)
Closes #1287
2021-04-19 12:41:57 -07:00
Henry Catalini Smith
11d09cffd7
Add -w shorthand for --watch CLI flag (#1276)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:23:05 -07:00
Christophe Coevoet
39f19bef98
Fix the name of the blackness argument (#1264)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:22:43 -07:00
Awjin Ahn
2ab4f8061c
Fix deprecation warning typo. (#1247)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:22:02 -07:00
Christophe Coevoet
fbd9cfd8a2
Fix a bunch of typos in comments (#1257)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:01:07 -07:00
Christophe Coevoet
7106bac9e2
Fix typos in the doc of SimpleSelector (#1251)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 13:55:30 -07:00
Natalie Weizenbaum
c2e02a50da Use ?[] instead of .andGet() 2021-04-14 19:11:10 -07:00
Natalie Weizenbaum
5535458edb Fix broken specs 2021-04-14 17:15:09 -07:00
awjin
af0f25cb0e Fix broken tests 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
102d3cedc2 Make the IO interface align with the VM API 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
654744f5f4 Fix bogus null assertions 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
de013bf8ac Make spans universally non-nullable 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
3ead2e2bb5 Split out an Extender class from Extension
This gets rid of the weird subset of "one-off" extensions which didn't
have target information available. Now instead, each method explicitly
declares whether it takes/returns extensions (which do have target
info) or extenders (which do not).
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
8fd3c1ba03 Rename Extender to ExtensionStore
"Extender" is also commonly used to refer to the parent selector of an
`@extend` rule, so this helps disambiguate.
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
e85d9a7afc Fix automated migrator errors
This gets the project analyzer-clean, but the tests are still failing.
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
81d952dc7d Automated null-safety migration 2021-04-14 17:15:08 -07:00
Jennifer Thakar
dfbdae0d71 Prepare for null-safety migration 2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
8fdb281e83 Make the first parameter to ImportCache() named, not mandatory
It was always valid to pass in `null`, this just makes it more clear.
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
984e76ef77 Remove type parameters from recursive AST visitors 2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
21e7ec19dc Split Declaration's constructor into two
This doesn't explicitly help null-safety, but it makes the
relationship between `Declaration.value` and `Declaration.children`
more obvious.
2021-04-14 17:15:03 -07:00
Natalie Weizenbaum
ca3c6f5ccc Refactor how style rules interact with at-root
This is more friendly to null-safe code, since we no longer rely on
`_inStyleRule` implying that `_styleRule != null`.
2021-04-12 17:31:11 -07:00
Natalie Weizenbaum
5d0ad6957b Split IfClause into ElseClause
This allows us to be statically explicit about when the expression
does or doesn't exist.
2021-04-12 17:31:11 -07:00
Natalie Weizenbaum
3fa2b1d98a Fix hints and lints 2021-04-12 17:31:11 -07:00
Jennifer Thakar
247cb3d816 Update dependencies to null-safe versions
This also replaces package_resolver with package_config, since
package_resolver is archived and is incompatible with null-safe Dart
packages.
2021-04-12 17:31:09 -07:00
Awjin Ahn
ad4a1692a8
Adds RenderOptions to the context of custom functions. (#1236) 2021-02-18 13:48:47 -08:00
Awjin Ahn
4ea9fff2bb
Let last !default value of @forward...with be commaless. (#1226)
This advances the scanner to the next line even if the !default
identifier is not followed by a comma.
2021-02-04 14:18:19 -08:00
Natalie Weizenbaum
2682992bd4
Split SassNumber into separate subclasses based on units (#1221)
This allows us to use more efficient implementations in the common
case where numbers don't have complex units.

See #113
2021-02-02 17:37:56 -08:00
Mary
058cf0e4df
Fix fuzzyAssertRange, RangeError takes ints as min/max 2021-01-29 13:34:31 -05:00
Natalie Weizenbaum
934bdd556a
Set RangeError.start and .end for color range checks (#1215)
This is useful for sass/dart-sass-embedded#32 because it makes the
range checks easier to deconstruct and reconstruct into useful
embedded error messages.
2021-01-27 15:50:02 -08:00
Natalie Weizenbaum
474956d9a8
Merge branch 'master' into node-api-bugs 2021-01-19 18:38:41 -08:00
Christophe Coevoet
f0720f204d
Implement proper handling of units in for loops (#1200)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-01-19 18:37:41 -08:00
Natalie Weizenbaum
072c5252ca Wrap fiber.yield() calls in runZoned()
This resets the current zone after the fiber returns, where otherwise
it could end up set to a different zone entirely, since Dart's Zone
API is unaware of fibers.

Closes #1204
2021-01-15 16:14:35 -08:00
Natalie Weizenbaum
f93feaf592 Don't try to cast an error to JsError
Dart's runtime understanding of what a "JsError" is isn't sufficient
to make sense of everything that might be thrown by, for example, a
custom function with an error.
2021-01-15 16:14:20 -08:00
Natalie Weizenbaum
66cb55c76f
Avoid throw/catch in Number.== (#1188)
Throwing and catching exceptions is expensive. Testing this on one
user's number-heavy codebase resulted in a 2x speed improvement.
2021-01-11 13:41:37 -08:00
Natalie Weizenbaum
01231e2f4c
Print the values of deprecated numbers passed to color functions (#1184)
See #1174
2021-01-06 15:17:53 -08:00
Natalie Weizenbaum
f24a2b9ca4
Avoid permissions errors in _realCasePath. (#1181)
This catches permissions errors and treats them as indicating that the
path component we have so far is canonical. This also improves the
efficiency of case matching by caching results for higher directories.
2021-01-06 12:49:45 -08:00
Sam Rawlins
006e6aa62f
Remove unnecessary imports (#1177)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2020-12-30 14:57:50 -08:00
Natalie Weizenbaum
bae2968757 Deprecate incorrect HSL units
Partially addresses #1174
2020-12-29 13:26:54 -08:00
Natalie Weizenbaum
f9a9373547 Print the LHS first in incompatible unit errors
Closes #766
2020-12-28 18:06:59 -08:00
Natalie Weizenbaum
d532f015f6 Improve error reporting for incompatible units
The new messages more consistently include argument names and actual
values. Errors about mixed unitless and unitful numbers are now more
consistent.
2020-12-28 17:58:55 -08:00
Natalie Weizenbaum
7ba7351148 Mark deprecation warnings as such 2020-12-28 14:44:00 -08:00
Natalie Weizenbaum
02c92aa7cd
Add support for clamp() as a special math function (#1168)
Closes #1146
See sass/sass#2860
2020-12-28 13:42:04 -08:00
Natalie Weizenbaum
bf623752fb
Avoid always downcasing file paths on Windows (#1172)
Closes #1169
2020-12-23 18:07:20 -08:00
Sam Rawlins
5aeef4ce81
Remove unused dart:async imports (#1160) 2020-12-09 14:20:51 -08:00
Natalie Weizenbaum
a13f7be81b
Apply the change in #1139 to the asynchronous source file (#1150) 2020-11-19 17:44:36 -08:00
Jennifer Thakar
4f1f5c9de8
Fix for importers that return null in load (#1139) 2020-11-10 09:44:37 -08:00
Natalie Weizenbaum
c0e6ba1b07
Fix a buggy interaction between @at-root and @keyframes (#1135) 2020-11-05 12:55:11 -08:00
Natalie Weizenbaum
939dca8e38
Support generalized @supports conditions (#1134)
Closes #894
See sass/sass#2780
2020-11-04 16:10:37 -08:00
Natalie Weizenbaum
f798aae0af
Reformat (#1133) 2020-11-03 16:03:08 -08:00
Natalie Weizenbaum
093ff58673 Merge branch 'master' into feature.hwb 2020-10-28 16:22:18 -07:00
Natalie Weizenbaum
290e55c2f1
Trim extends at the compound selector level (#1124)
This reverts a portion of #460 (15202c4). It turns out that trimming
compound selector extends allows us to avoid exponential behavior in
certain recursive @extend cases.

See sass/dart-sass#1109
2020-10-28 15:11:22 -07:00
Natalie Weizenbaum
a9a3946fb4
Use node_interop rather than manually declaring Node APIs (#1127) 2020-10-28 15:00:05 -07:00
Natalie Weizenbaum
300197caf9
Don't crash when using Infinity or NaN as a key in a map (#1073)
Closes #3126
2020-10-27 16:38:47 -07:00
Natalie Weizenbaum
c4f95d4310
Fix the argument name for meta.load-css() (#1072)
Closes #1054
2020-10-27 15:54:14 -07:00
Natalie Weizenbaum
197c6dbbde
Emit a proper parse error for = with no RHS in a function (#1071)
Closes #1050
2020-10-27 15:47:48 -07:00
Jennifer Thakar
6c679e13d4
Support HWB in adjust, change, and scale (#1111)
This adds `$whiteness` and `$blackness` parameters to the `adjust`,
`change`, and `scale` functions in the color module.

In doing so, I generalized the logic for all three functions into a
single `_updateComponents` helper since they all shared a lot of similar
logic for validating their parameters.
2020-10-14 19:45:35 -07:00
Natalie Weizenbaum
7ba5128423
Add color.whiteness() and color.blackness() functions (#1110)
See sass/sass#2834
See #1089
2020-10-14 16:15:46 -07:00
Natalie Weizenbaum
b0f213c22f Merge remote-tracking branch 'origin/master' into feature.hwb 2020-10-09 17:29:47 -07:00
Natalie Weizenbaum
4bc49044c4
Add a missing word
Co-authored-by: Awjin Ahn <awjin@google.com>
2020-10-07 15:18:00 -07:00
Natalie Weizenbaum
f981227cc0
Merge branch 'master' into fix-type-check 2020-10-07 15:07:12 -07:00
Natalie Weizenbaum
1ceaec71ff Fix custom property parsing in plain CSS
Closes #1104
2020-10-07 14:49:16 -07:00
Natalie Weizenbaum
c14cb73b08
Merge branch 'master' into feature.nested-maps 2020-10-05 17:59:59 -07:00
Natalie Weizenbaum
ec0bab5538
Fix a bug with nested properties beneath Sass-syntax custom props (#1096)
Closes #1095
2020-10-05 17:58:53 -07:00
Natalie Weizenbaum
2198aa7dab
Merge branch 'master' into feature.nested-maps 2020-10-05 17:31:41 -07:00
Michael R Fairhurst
82b2779d5c
Remove unused dart:async imports (#1097)
* Remove unused dart:async imports

Since Dart 2.1, Future and Stream have been exported from dart:core

* Run grinder
2020-10-05 09:35:03 -07:00
Natalie Weizenbaum
d3691d44f0
Add a color.hwb() function (#1092)
See sass/sass#2834
See #1089
2020-09-23 11:45:31 -07:00
Jennifer Thakar
56d979d04d
Add a map.deep-remove() function (#1091) 2020-09-22 16:11:48 -07:00
Awjin Ahn
45703ab597
Adds nested map support to map-merge. (#1083) 2020-09-18 12:18:27 -07:00
Natalie Weizenbaum
f843f96bc2
Produce a better error for positional arguments after named (#1087)
Closes #1086
2020-09-17 17:50:19 -07:00
Natalie Weizenbaum
1918674295
Support HWB colors in SassColor (#1085)
See sass/sass#2835
2020-09-17 16:18:12 -07:00
Awjin Ahn
5b7471664d
Add a map.set() function (#1078) 2020-09-16 15:47:35 -07:00
Jennifer Thakar
f5e3a5a669
Add support for nested maps to has-key (#1075) 2020-09-16 14:41:23 -07:00
Jennifer Thakar
6b66241e95
Add support for nested maps to map-get (#1076) 2020-09-16 13:23:52 -07:00
Natalie Weizenbaum
028b2f6a01 Add a map.deep-merge() function (#1077) (#1080)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 16:25:49 -07:00
Natalie Weizenbaum
015a76cf0b Revert "Add a map.deep-merge() function (#1077) (#1080)"
This reverts commit 315e86b442.

Once again, this was supposed to go on feature.nested-maps.
2020-09-15 16:24:53 -07:00
Natalie Weizenbaum
315e86b442
Add a map.deep-merge() function (#1077) (#1080)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 16:23:01 -07:00
Natalie Weizenbaum
9503b57ac5 Revert "Add a map.deep-merge() function (#1077)"
This reverts commit bc7216a441.

This was intended to land on a feature branch, not on master.
2020-09-15 15:17:55 -07:00
Natalie Weizenbaum
bc7216a441
Add a map.deep-merge() function (#1077)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 13:03:38 -07:00
Natalie Weizenbaum
a06295426d
Throw a proper error when the same built-in module is @used twice (#1070)
Closes #1047
2020-09-04 12:26:29 -07:00
Natalie Weizenbaum
1dff9a7ce4
Don't crash when writing Infinity in JS mode (#1069)
Closes #1031
2020-09-04 12:25:42 -07:00