【问题标题】:Foundation 5 SCSS Compilation via scssPHPFoundation 5 SCSS 通过 scssPHP 编译
【发布时间】:2014-01-06 17:48:38
【问题描述】:

我使用lessPHP 将bootstrap less 文件编译成最终的CSS 文件已经有一段时间了,并且对Zurb's Foundation 产生了兴趣。只有 PHP 知识我尝试过使用 scssPHP 将 SCSS 编译成 CSS:

请注意,我使用了这种方法,当使用 lessPHP 和 bootstrap 的 less 文件时,一切似乎都运行良好。

    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 中第一次遇到错误的部分,并且似乎在 Foundation 5 scss 中发生,无论何时调用 mixins,即使我将其删除以进行检查。

@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?谢谢!

【问题讨论】:

  • 我已经通过将 scss.inc.php 替换为位于here的以下修复解决了这个问题
  • 该修复已被拉入官方存储库

标签: sass zurb-foundation


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-29
    相关资源
    最近更新 更多