How do I change the color and width of material drawer component in angular-dart in css?

廉价感情. 提交于 2019-12-13 03:34:50

问题


My first question ever - so apologies if I am not specific enough. How do I change the color and width of material drawer component in angular-dart in css? I have tried it several ways in the CSS, including as below:

::ng-deep material-drawer {
  color: #9437FF;
  width: 200px;
}

.material-drawer {
  color: #9437FF;
  width: 200px;
}

FYI, the following worked with the material-header, which is inside a header tag:

::ng-deep header.material-header.material-header {
  background-color: white;
  color: #9437FF;
}

My material-drawer is not in a div or anything, just directly an HTML element on its own.

Any pointers are appreciated!


回答1:


Setting the width of the drawer is a bit complicated. It involves setting a good amount of values as such it is best to use the mixin. You can see an example here

As for the color that is a little bit harder. What color are you trying to change? The background color?

For the background color you can set the background-color on the drawer. The problem is going to be that the content itself is going to override that color. In this case the material-list has it's own white color associated with it. Removing that color you could have problems with the divider colors.



来源:https://stackoverflow.com/questions/51308040/how-do-i-change-the-color-and-width-of-material-drawer-component-in-angular-dart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!