Skip to content

Commit 0a2142d

Browse files
authored
Don't include leading underscores in implicit namespaces (#955)
Closes #934 See sass/sass#2800
1 parent 3e47570 commit 0a2142d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 1.26.0-test.1
22

3+
* `@use` rules whose URLs' basenames begin with `_` now correctly exclude that
4+
`_` from the rules' namespaces.
5+
36
* Don't throw errors if the exact same member is loaded or forwarded from
47
multiple modules at the same time.
58

lib/src/parse/stylesheet.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,8 @@ relase. For details, see http://bit.ly/moz-document.
13821382

13831383
var basename = url.pathSegments.isEmpty ? "" : url.pathSegments.last;
13841384
var dot = basename.indexOf(".");
1385-
var namespace = basename.substring(0, dot == -1 ? basename.length : dot);
1385+
var namespace = basename.substring(
1386+
basename.startsWith("_") ? 1 : 0, dot == -1 ? basename.length : dot);
13861387
try {
13871388
return Parser.parseIdentifier(namespace, logger: logger);
13881389
} on SassFormatException {

0 commit comments

Comments
 (0)