如果您查看\bower_components\foundation\scss 内部,您会看到文件foundation.scss。该文件导入 Foundation 5“包”中所有附加组件的所有样式表。在您的根 scss 目录中,app.scss 将 SASS 编译为 \stylesheets\app.css。所以而不是这样:
@import "foundation";
取消注释您将使用的各个组件。像这样的:
@import
//"foundation/components/accordion",
//"foundation/components/alert-boxes",
"foundation/components/block-grid",
//"foundation/components/breadcrumbs",
//"foundation/components/button-groups",
//"foundation/components/buttons",
"foundation/components/clearing",
"foundation/components/dropdown",
//"foundation/components/dropdown-buttons",
//"foundation/components/flex-video",
"foundation/components/forms",
"foundation/components/grid",
//"foundation/components/inline-lists",
//"foundation/components/joyride",
//"foundation/components/keystrokes",
//"foundation/components/labels",
//"foundation/components/magellan",
//"foundation/components/orbit",
//"foundation/components/pagination",
//"foundation/components/panels",
//"foundation/components/pricing-tables",
//"foundation/components/progress-bars",
"foundation/components/reveal",
"foundation/components/side-nav",
//"foundation/components/split-buttons",
"foundation/components/sub-nav",
//"foundation/components/switches",
"foundation/components/tables",
//"foundation/components/tabs",
//"foundation/components/thumbs",
//"foundation/components/tooltips",
"foundation/components/top-bar",
"foundation/components/type",
"foundation/components/offcanvas",
"foundation/components/visibility";
如果您想简化文件结构,我建议您从 \bower_components\foundation\scss\foundation\components 目录中删除您不会使用的所有 scss 文件。与js 目录相同。您实际上不需要修改bower_components 目录中的任何内容即可使一切正常工作。不完全确定为什么它都包含在 bower_components 中,但我想这与以后能够在未来的版本中更新核心组件有关。
其他人可能会给出更有根据的答案。
附言- 确保在您的 CLI 中compass watch 以查看对您的 SASS 文件所做的任何更改。