基础5 SCSS编译通过scssPHP

时间:2013-12-10 08:40:41

标签: sass zurb-foundation

我一直在使用lessPHP将bootstrap较少的文件编译成最终的CSS文件很长一段时间,并对Zurb的Foundation感兴趣。只有PHP知识我尝试使用scssPHP编译SCSS到CSS:

请注意我使用这种方法,当使用lessPHP和bootstrap的文件较少时,一切似乎都正常。

    require_once("scssPHP/scss.inc.php");
    $scss = new scssc;
    return $scss->compile($foo);

$ foo包含主基础scss文件中的内容以及其余.scss文件的导入。

编译时,我收到以下回复:

<br />
<b>Fatal error</b>:  Uncaught exception 'Exception' with message 'expecting color: failed at `$bg-lightness: lightness($bg);
` /[foundation folder]/scss/_alert-boxes.scss on line 62' in /[scssphp folder]/scss.inc.php:3899
Stack trace:
#0 /[scssphp folder]/scss.inc.php(2364): scss_parser-&gt;throwParseError('expecting color', 2029)
#1 /[scssphp folder]/scss.inc.php(1701): scssc-&gt;throwError('expecting color')
#2 /[scssphp folder]/scss.inc.php(2035): scssc-&gt;assertColor(Array)
#3 [internal function]: scssc-&gt;lib_lightness(Array, Object(scssc))
#4 /[scssphp folder]/scss.inc.php(1588): call_user_func(Array, Array, Object(scssc))
#5 /[scssphp folder]/scss.inc.php(945): scssc-&gt;callBuiltin('lightness', Array, NULL)
#6 /[scssphp folder]/scss.inc.php(591): scssc-&gt;reduce(Array)
#7 /[scssphp folder]/scss.inc.php(723): scssc-&gt;compi in <b>[scssphp folder]/scss.inc.php</b> on line <b>3899</b><br />

这是_alert-boxes.scss中第一次遇到错误的部分,即使我删除了要检查的内容,每当调用mixins时,似乎都会通过Foundation 5 scss发生。

@mixin alert-style($bg:$primary-color) {
// This find the lightness percentage of the background color.
$bg-lightness: lightness($bg);
// We control which background color and border come through.
background-color: $bg;
border-color: darken($bg, $alert-function-factor);
// We control the text color for you based on the background color.
@if $bg-lightness > 70% { color: $alert-font-color-alt; }
@else { color: $alert-font-color; }
}

有谁知道这里的问题是什么,或者我是否可以使用任何其他方法/脚本将scss编译成css?谢谢!

1 个答案:

答案 0 :(得分:0)

这已在scssPHP中修复,因此升级到最新版本(撰写本文时为0.0.9)将解决此问题。