How do I change the color and width of material dr

2019-08-21 08:48发布

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条回答
太酷不给撩
2楼-- · 2019-08-21 08:55

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.

查看更多
登录 后发表回答