Ngx-chips自定义主题无效

mr_*_*ash 0 javascript angular angular5 ngx-chips

很棒的组件。我在Angular 5中使用了最新版本的ngx-chips。我试图使自定义主题与此处相同,但不起作用。这是我的.scss文件:

@import '~ngx-chips/core/styles/core/_core.scss';

$foundation-primary: #1779ba;
$foundation-primary-dark: darken($foundation-primary, 10%);

// this is the container's theme
$foundation-theme: (
container-border-bottom: 1px solid $foundation-primary
);

// this is the tag's theme
$foundation-tag-theme: (
background: $foundation-primary,
background-focused: $foundation-primary-dark,
background-active: $foundation-primary-dark,
background-hover: $foundation-primary-dark,
color: #fff,
color-hover: #fff,
border-radius: 2px
);

// this is the delete icon's theme
$foundation-icon-theme: (
fill: #fff,
fill-focus: #eee,
transition: all 0.35s
);

// apply theme to the container
:ng-deep .ng2-tag-input.foundation-theme {
@include tag-input-theme($foundation-theme);
}

// apply theme to the tags
:ng-deep .ng2-tag-input.foundation-theme tag {
@include tag-theme($foundation-tag-theme);
}

// apply theme to the delete icon
:ng-deep .ng2-tag-input.foundation-theme tag delete-icon {
@include icon-theme($foundation-icon-theme);
}
Run Code Online (Sandbox Code Playgroud)

我也发现了同样的问题,但没有答案。我究竟做错了什么?

小智 5

使用':: ng-deep'代替':ng-deep'