-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #787 from andrewtch/bs4-fix
Added SassUtils for better compatibility with bootstrap 4 (and scss comments overall)
- Loading branch information
Showing
5 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Assetic package, an OpenSky project. | ||
* | ||
* (c) 2010-2015 OpenSky Project Inc | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Assetic\Util; | ||
|
||
/** | ||
* Sass Utils. | ||
* | ||
* @author Kris Wallsmith <[email protected]> | ||
*/ | ||
abstract class SassUtils extends CssUtils | ||
{ | ||
const REGEX_COMMENTS = '/((?:\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)|\/\/[^\n]+)/'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Assetic package, an OpenSky project. | ||
* | ||
* (c) 2010-2015 OpenSky Project Inc | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Assetic\Test\Util; | ||
|
||
use Assetic\Util\SassUtils; | ||
|
||
class SassUtilsTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testExtractImports() | ||
{ | ||
|
||
$content = <<<CSS | ||
// @import 'not_needed.css'; | ||
//@import "not_needed.css"; | ||
body{} // @import 'nod_needed.css'; | ||
@import 'custom.css'; | ||
@import "common.css" screen, projection; | ||
body { background: url(../images/bg.gif); } | ||
CSS; | ||
|
||
$expected = array('common.css', 'custom.css'); | ||
$actual = SassUtils::extractImports($content); | ||
|
||
$this->assertEquals($expected, array_intersect($expected, $actual), '::extractImports() returns all expected URLs'); | ||
$this->assertEquals(array(), array_diff($actual, $expected), '::extractImports() does not return unexpected URLs'); | ||
} | ||
} |