0
我一直在使用lessPHP編譯引導較少的文件到最終的CSS文件很長一段時間,並對Zurb的基金會感興趣。只有PHP知識我已經嘗試編譯SCSS到CSS,就像使用scssPHP一樣:基金會5 SCSS編譯通過scssPHP
請注意,我使用這種方法,並且在引導程序的less文件中使用lessPHP時,似乎一切正常。
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->throwParseError('expecting color', 2029)
#1 /[scssphp folder]/scss.inc.php(1701): scssc->throwError('expecting color')
#2 /[scssphp folder]/scss.inc.php(2035): scssc->assertColor(Array)
#3 [internal function]: scssc->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->callBuiltin('lightness', Array, NULL)
#6 /[scssphp folder]/scss.inc.php(591): scssc->reduce(Array)
#7 /[scssphp folder]/scss.inc.php(723): scssc->compi in <b>[scssphp folder]/scss.inc.php</b> on line <b>3899</b><br />
這是遇到的第一次錯誤,似乎通過基金會5 SCSS每當權發生在_alert-boxes.scss部分即使我刪除這個檢查,mixin也會被調用。
@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?謝謝!
我已經與位於[這裏]以下修復程序修復(https://github.com/timonbaetz/scssphp/blob/8e9ad859b8648d972c1b39bde0ad629bfb1b8eaa/scss.inc.php) – artletic
更換scss.inc.php解決問題已被拉入官方存儲庫 – George