예제 #1
1
파일: 035Test.php 프로젝트: poef/ariadne
    public function testIssue()
    {
        $parser = new ILess_Parser();
        $parser->setVariables(array('mycolor' => 'transparent'));
        $parser->parseString('.test{
  background-color: @mycolor;
}');
        $css = $parser->getCSS();
        $expected = '.test {
  background-color: transparent;
}
';
        $this->assertEquals($expected, $css);
    }
예제 #2
0
파일: 050Test.php 프로젝트: poef/ariadne
    public function testIssueWithApiVariables()
    {
        $parser = new ILess_Parser(array('compress' => false));
        $parser->parseString('
@import "../../../bootstrap3/less/@{swatch}/variables.less";
');
        $parser->setVariables(array('swatch' => 'foobar'));
        $this->setExpectedException('ILess_Exception_Import', '/bootstrap3/less/foobar/variables.less');
        $css = $parser->getCSS();
    }
예제 #3
0
파일: 052Test.php 프로젝트: poef/ariadne
    public function testIssue()
    {
        $parser = new ILess_Parser(array('compress' => false));
        $parser->parseString('
#mxtest {
  color2: @b;
  alpha: alpha(@a);
  color: darken(@a, 20);
  background: -moz-linear-gradient(top, @a 0%, darken(@a, 20) 100%);
}');
        $parser->setVariables(array('a' => 'rgb(46, 120, 176)', 'b' => 'rgba(0,1,2,0.3)'));
        $css = $parser->getCSS();
        $this->assertContains('alpha: 1;', $css);
        $this->assertContains('color2: rgba(0, 1, 2, 0.3);', $css);
    }