我需要根据参数更改应用程序的颜色主题,这应该是一个非常简单的操作。在我的应用程序中,我使用 Fuse 角度材质主题。当我尝试从主要主题切换到次要主题时,对话框组件的强调色不会更改,而其他组件(例如导航栏)会更改。
_主题.scss
@import '~@angular/material/theming';
@import './component-themes';
$primary: mat-palette($mat-fusedark);
$accent: mat-palette($mat-light-blue, 600, 400, 700);
$warn: mat-palette($mat-red);
$white: mat-palette($mat-white);
$black: mat-palette($mat-black);
$first-theme: mat-light-theme($primary, $accent, $warn);
$background: map-get($first-theme, background);
$foreground: map-get($first-theme, foreground);
@include angular-material-theme($first-theme);
@include component-themes($first-theme);
$second-primary: mat-palette($mat-fusedark);
$second-accent: mat-palette($mat-green, 600, 400, 700);
$second-warn: mat-palette($mat-red);
$second-theme: mat-light-theme($second-primary, $second-accent, $second-warn);
.second-theme {
@include angular-material-theme($second-theme);
@include component-themes($second-theme);
}
Run Code Online (Sandbox Code Playgroud)
组件主题.scss
@import "../partials/navigation";
@import "../partials/dialog";
@mixin component-themes($theme) {
@include navigation-theme($theme);
@include dialog-theme($theme);
}
Run Code Online (Sandbox Code Playgroud)
_dialog.scss
@import '~@angular/material/theming';
@mixin dialog-theme($theme) {
$accent: map-get($theme, accent);
.dialog-wrapper {
.mat-dialog-container …Run Code Online (Sandbox Code Playgroud) 我的 vis.js 有问题,我无法增加节点的大小及其标签的字体。
nodes.push({id: el, label: currentNode.hostName,font: {color:'#FF9900', face:'courier',size:300}, group: "Domain", color:{background: getColor(currentNode) , border: getColor(currentNode) }, value: 10000, title: label,labelHighlightBold: true, borderWidthSelected: 7 });
Domain: {
shape: 'triangleDown',
shapeProperties: {
useImageSize: false,
size:3333
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢