Skip to content

Commit d395f6f

Browse files
committed
@import - implicit .scss extension when not specified; otherwise limit to explicit .css and .scss extension; mitigates leafo#487
1 parent e7aa77e commit d395f6f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Compiler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3390,6 +3390,8 @@ public function findImport($url)
33903390
$urls = [$url, preg_replace('/[^\/]+$/', '_\0', $url)];
33913391
}
33923392

3393+
$hasExtension = preg_match('/[.]s?css$/', $url);
3394+
33933395
foreach ($this->importPaths as $dir) {
33943396
if (is_string($dir)) {
33953397
// check urls for normal import paths
@@ -3399,7 +3401,7 @@ public function findImport($url)
33993401
. $full;
34003402

34013403
if ($this->fileExists($file = $full . '.scss') ||
3402-
$this->fileExists($file = $full)
3404+
($hasExtension && $this->fileExists($file = $full))
34033405
) {
34043406
return $file;
34053407
}

0 commit comments

Comments
 (0)