Skip to content

Commit 1a5102b

Browse files
authored
Merge pull request #869 from sass/second-law-use
Propagate selector source specificity between modules
2 parents 3392db0 + be4ca60 commit 1a5102b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.23.3
2+
3+
* Fix a bug where selectors were being trimmed over-eagerly when `@extend`
4+
crossed module boundaries.
5+
16
## 1.23.2
27

38
### Command-Line Interface

lib/src/extend/extender.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ class Extender {
400400

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

671672
var lineBreak = false;
672-
var specificity = _sourceSpecificityFor(compound);
673673
for (var state in path) {
674674
state.assertCompatibleMediaContext(mediaQueryContext);
675675
lineBreak = lineBreak || state.extender.lineBreak;
676-
specificity = math.max(specificity, state.specificity);
677676
}
678677

679678
return complexes

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.23.2
2+
version: 1.23.3
33
description: A Sass implementation in Dart.
44
author: Sass Team
55
homepage: https://github.com/sass/dart-sass

0 commit comments

Comments
 (0)