Sass 基于SCSSPHP的基础5 SCSS编译 我一直在使用LESSPHP来编译Bootstrap更少的文件到最终的CSS文件中很长一段时间,并对Zurb的基础感兴趣。由于只有PHP知识,我尝试使用scssPHP将SCS编译成CSS:
请注意,我使用了这种方法,当使用LESSHP和bootstrap的较少文件时,一切似乎都很好Sass 基于SCSSPHP的基础5 SCSS编译 我一直在使用LESSPHP来编译Bootstrap更少的文件到最终的CSS文件中很长一段时间,并对Zurb的基础感兴趣。由于只有PHP知识,我尝试使用scssPHP将SCS编译成CSS:,sass,zurb-foundation,Sass,Zurb Foundation,请注意,我使用了这种方法,当使用LESSHP和bootstrap的较少文件时,一切似乎都很好 require_once("scssPHP/scss.inc.php"); $scss = new scssc; return $scss->compile($foo); $FO包含来自主要基础SCSS文件的内容以及其他.SCSS文件的导入。 编译时,我得到以下响应: <br /> <b>Fatal error</b>: Uncau
require_once("scssPHP/scss.inc.php");
$scss = new scssc;
return $scss->compile($foo);
$FO包含来自主要基础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 />
有没有人知道这里有什么问题,或者我是否可以使用任何其他方法/脚本将SCS编译成css?谢谢 这在scssPHP中已修复,因此升级到最新版本(编写本文时为0.0.9)将解决此问题。我已通过使用以下修复程序替换scss.inc.php解决了此问题,该修复程序已被拉入官方存储库
@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; }
}