【问题标题】:Using SASS partials in Brackets在括号中使用 SASS 部分
【发布时间】:2015-02-02 04:18:33
【问题描述】:

所以我开始使用 Brackets 作为我的 IDE,并一直在尝试获取 SASS 以及我需要处理的所有其他内容。所以当我在玩的时候,我意识到我无法与其他部分文件共享我的部分文件。我正在使用"brackets-sass" extension by jasonsanjose

我的sass文件夹结构如下,

sass
 |-> includes
          _config.sass
          _base.sass
          _reset.sass
          _utilities.sass
          _helpers.sass
          _main.sass
 style.sass

我在 _config.sass 文件中声明了一堆变量,但无法在任何其他部分文件中访问它们。我想知道这怎么可能,或者如果扩展的这个功能还没有实现,我该怎么做。

我的 .brackets.json 文件看起来像这样,

{
    "sass.enabled": false,
    "path": {
        "sass/style.sass": {
            "sass.enabled": true,
        "sass.options": {
            "includePaths": [
                "../sass/includes"
            ],
            "outputDir": "../css/",                
            "imagePath": null,
            "sourceComments": "map",
            "outputStyle": "nested"
        }
    },

        "sass/includes/*.sass": {
            "sass.enabled": false
        }
    }
}

如果我尝试将部分文件导入另一个文件,它会提示以下错误, " 找不到或无法读取要导入的文件:'includes/config' @import 'includes/config' " 如果我尝试在 _config.sass 的任何其他部分文件中使用变量,我会收到以下错误, “未绑定变量 $var_name”。

我们将不胜感激。谢谢。

干杯

【问题讨论】:

  • 我不得不重新安装扩展。现在可以使用了。

标签: css html sass adobe-brackets


【解决方案1】:

Paths 和 sass.options 位置不对,我也遇到过类似问题。

我让它在括号.json 中使用以下首选项 适用于多个入口点并包含路径目录。 而不是波旁威士忌/整洁添加您的包含。

{
    "sass.enabled": false,
    "sass.options": {
        "includePaths": [
            "../node_modules/node-bourbon/assets/stylesheets",
            "../node_modules/node-neat/assets/stylesheets"
        ],
        "outputDir": "../css/",
        "imagePath": null,
        "sourceComments": false,
        "outputStyle": "nested"
    },
    "linting.collapsed": false,
    "spaceUnits": 2,
    "path": {
        "scss/app.scss": {
            "sass.enabled": true   
        },

        "scss/teaser.scss": {
            "sass.enabled": true
        }
    }
}

希望有帮助!

【讨论】:

  • 谢谢。它做了。现在有了新的更新就更容易了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多