Skip to content

Commit

Permalink
Merge pull request #869 from sass/second-law-use
Browse files Browse the repository at this point in the history
Propagate selector source specificity between modules
  • Loading branch information
nex3 authored Nov 1, 2019
2 parents 3392db0 + be4ca60 commit 1a5102b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.23.3

* Fix a bug where selectors were being trimmed over-eagerly when `@extend`
crossed module boundaries.

## 1.23.2

### Command-Line Interface
Expand Down
3 changes: 1 addition & 2 deletions lib/src/extend/extender.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ class Extender {

for (var extender in extenders) {
if (extender.isEmpty) continue;
_sourceSpecificity.addAll(extender._sourceSpecificity);
extender._extensions.forEach((target, newSources) {
// Private selectors can't be extended across module boundaries.
if (target is PlaceholderSelector && target.isPrivate) return;
Expand Down Expand Up @@ -669,11 +670,9 @@ class Extender {
}

var lineBreak = false;
var specificity = _sourceSpecificityFor(compound);
for (var state in path) {
state.assertCompatibleMediaContext(mediaQueryContext);
lineBreak = lineBreak || state.extender.lineBreak;
specificity = math.max(specificity, state.specificity);
}

return complexes
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.23.2
version: 1.23.3
description: A Sass implementation in Dart.
author: Sass Team
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit 1a5102b

Please sign in to comment.