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); }
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(); }
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); }