Skip to content

Commit

Permalink
@import - implicit .scss extension when not specified; otherwise limi…
Browse files Browse the repository at this point in the history
…t to explicit .css and .scss extension; mitigates #487
  • Loading branch information
robocoder committed Jan 10, 2017
1 parent e7aa77e commit d395f6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3390,6 +3390,8 @@ public function findImport($url)
$urls = [$url, preg_replace('/[^\/]+$/', '_\0', $url)];
}

$hasExtension = preg_match('/[.]s?css$/', $url);

foreach ($this->importPaths as $dir) {
if (is_string($dir)) {
// check urls for normal import paths
Expand All @@ -3399,7 +3401,7 @@ public function findImport($url)
. $full;

if ($this->fileExists($file = $full . '.scss') ||
$this->fileExists($file = $full)
($hasExtension && $this->fileExists($file = $full))
) {
return $file;
}
Expand Down

0 comments on commit d395f6f

Please sign in to comment.