Skip to content

Commit

Permalink
Don't include leading underscores in implicit namespaces (#955)
Browse files Browse the repository at this point in the history
Closes #934
See sass/sass#2800
  • Loading branch information
nex3 authored Feb 12, 2020
1 parent 3e47570 commit 0a2142d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 1.26.0-test.1

* `@use` rules whose URLs' basenames begin with `_` now correctly exclude that
`_` from the rules' namespaces.

* Don't throw errors if the exact same member is loaded or forwarded from
multiple modules at the same time.

Expand Down
3 changes: 2 additions & 1 deletion lib/src/parse/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,8 @@ relase. For details, see http://bit.ly/moz-document.

var basename = url.pathSegments.isEmpty ? "" : url.pathSegments.last;
var dot = basename.indexOf(".");
var namespace = basename.substring(0, dot == -1 ? basename.length : dot);
var namespace = basename.substring(
basename.startsWith("_") ? 1 : 0, dot == -1 ? basename.length : dot);
try {
return Parser.parseIdentifier(namespace, logger: logger);
} on SassFormatException {
Expand Down

0 comments on commit 0a2142d

Please sign in to comment.