Merge pull request #869 from sass/second-law-use

Propagate selector source specificity between modules
This commit is contained in:
Natalie Weizenbaum 2019-10-31 22:51:39 -07:00 committed by GitHub
commit 1a5102bedb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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;
@ -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

View File

@ -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