【发布时间】:2018-08-29 18:50:11
【问题描述】:
我将一个 SASS 文件中的 mixin 包含到另一个文件中,但使用 ionic serve 命令时出现错误:
Error: "Sass Error
Invalid CSS after " @include": expected identifier, was '"../../../theme/mai'"
这是我要导入 mixin 的文件:
action-sheet-layout-1 {
@include '../../../theme/main.scss'
@include "settingAnimationHeader"; // this mixin is defined in main.scss
[button-action-shit] {
z-index: 99999; right: 16px; top: 56px;
...
}
main.scss中定义的mixin:
@mixin settingAnimationHeader {
@keyframes headerOff {
from {
background-color: theme-colors('mainColors', 'primary');
}
to {
background-color: transparent;
}
}
...
}
我是 ionic 和 SASS 的新手,我做对了还是错过了什么?
应用根目录下两个文件的目录结构:
src/theme/main.scss # the mixin is defined in this file.
src/components/action-sheet/layout-1/action-sheet-layout-1.scss # the mixin is imported here.
【问题讨论】: