【发布时间】:2017-02-06 00:31:36
【问题描述】:
我在全局 SCSS 文件中有一个通用的 SCSS 混合函数。但我无法访问 angular2 组件中的 mixin 函数。
我有全局 style.scss 有以下 mixin 功能
@mixin respond-to($breakpoint) {
@if $breakpoint == "small" {
@media (max-width: 767px) {
@content;
}
}
@else if $breakpoint == "medium" {
@media (min-width: 992px) {
@content;
}
}
@else if $breakpoint == "large" {
@media (min-width: 1200px) {
@content;
}
}
}
我正在尝试在 component.scss 中访问这个 mixin 函数,比如
.procard{
width:50%;
@include respond-to(small){
.pro-card{
width: 100%;
.pro-box{
max-width: 320px;
margin:0 auto;
}
}
}
}
运行时显示错误
【问题讨论】:
-
你有我的问题吗?
-
@importcomponent.scss在style.scssrespond-to定义之后。 -
@MaheswaranS。你找到这个问题的答案了吗。有同样的要求!!
-
@bhavya_w。还没找到。
标签: css angular sass scss-lint