Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
parsing associated with it. It is now parsed like any other unknown plain CSS
at-rule, where Sass features are only allowed within `#{}` interpolation.

* **Breaking change:** A variable definition may now only have a single
`!global` flag or `!default` flag, or one of each.

### Bogus Combinators

* **Breaking change:** Selectors with more than one combinator in a row, such as
Expand Down
3 changes: 2 additions & 1 deletion lib/src/deprecation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum Deprecation {
// DO NOT EDIT. This section was generated from the language repo.
// See tool/grind/generate_deprecations.dart for details.
//
// Checksum: f9088047deb7019c0d619480b54cea07a65abbb4
// Checksum: d1c9c01ca8d2b69e39b7371d774c9c86349efdef

/// Deprecation for passing a string directly to meta.call().
callString('call-string',
Expand Down Expand Up @@ -70,6 +70,7 @@ enum Deprecation {
/// Deprecation for using !default or !global multiple times for one variable.
duplicateVarFlags('duplicate-var-flags',
deprecatedIn: '1.62.0',
obsoleteIn: '2.0.0',
description:
'Using !default or !global multiple times for one variable.'),

Expand Down
18 changes: 4 additions & 14 deletions lib/src/parse/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,8 @@ abstract class StylesheetParser extends Parser {
switch (identifier()) {
case 'default':
if (guarded) {
warnings.add((
deprecation: Deprecation.duplicateVarFlags,
message:
'!default should only be written once for each variable.\n'
'This will be an error in Dart Sass 2.0.0.',
span: scanner.spanFrom(flagStart),
));
error('Only one !default is allowed per declaration.',
scanner.spanFrom(flagStart));
}
guarded = true;

Expand All @@ -272,13 +267,8 @@ abstract class StylesheetParser extends Parser {
scanner.spanFrom(flagStart),
);
} else if (global) {
warnings.add((
deprecation: Deprecation.duplicateVarFlags,
message:
'!global should only be written once for each variable.\n'
'This will be an error in Dart Sass 2.0.0.',
span: scanner.spanFrom(flagStart),
));
error('Only one !global is allowed per declaration.',
scanner.spanFrom(flagStart));
}
global = true;

Expand Down
Loading