【问题标题】:Susy syntax error: Undefined mixing 'span-columns'Susy 语法错误:未定义的混合 'span-columns'
【发布时间】:2016-08-02 03:10:18
【问题描述】:

我是 Susy 的新手,我正在尝试使用 span-columns mixin,但是我收到以下错误:

Syntax error: Undefined mixin 'span-columns'

我已安装 compass-susy-plugin (0.9),但未安装 Susy gem。

SCSS 文件包括 screen.scss 和 _base.scss

screen.scss

// Imports -------------------------------------------------------------------

@import "base";
@import "typography";

/* Layout ------------------------------------------------------------------*/

.container {
  @include container;
  @include susy-grid-background;
}

.main {
    @include span-columns(8,12);
}

.left-sidebar {  
  @include columns(2);  
  @include alpha;
  background-color: red;  
}

.right-sidebar {  
  @include columns(2);  
  @include omega;  
  background-color: red;
}

_base.scss

// Imports -------------------------------------------------------------------

@import "susy";

// Grid ----------------------------------------------------------------------

$total-cols             : 12;
$col-width              : 4em;
$gutter-width           : 1em;
$side-gutter-width      : $gutter-width;

$show-grid-backgrounds  : true;

【问题讨论】:

  • 此问题现已解决。我基本上删除了 compass 和 susy 并重新安装它现在可以工作了。

标签: susy-compass


【解决方案1】:

根据我的变更日志,0.9 版中的列 mixin 在 1.0 版中被重命名为 span-columns,所以我会说跨度列 mixin 在 Susy 的 0.9 分支中不存在。

当前版本是 1.0.5,这是我使用的没有问题的版本(到目前为止)。

【讨论】:

  • 感谢@greyman,解决了问题1,但是现在我得到了以下error sass/screen.scss (Line 24 of sass/_base.scss: Undefined mixin 'columns'.)
  • 那是因为 columns 被重命名为 span-columns - 你似乎在你的风格中都使用了这两个。
  • 看到您更新了 Susy,将所有出现的 columns 更改为 span-columns,您应该一切顺利。
【解决方案2】:

这是来自文档的另一个答案:

Susy 2.x 支持两个并排的语法选项。如果您想使用最新版本但保留旧语法,请将您的导入从 susy 更改为 susyone。

// 安装了 Susy 2.x... @import "susyone";

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-01
    • 1970-01-01
    相关资源
    最近更新 更多