jelbourn / material2-app

Simple app that consumes Angular Material 2 components
651 stars 280 forks source link

Customise the width of dropdowns to match the width of each select #37

Open traffic-nz opened 7 years ago

traffic-nz commented 7 years ago

So far, the only way I've found to customise the width of the dropdowns is to add a class to md-option and then add the custom width to the select.component.ts file... which is terrible practice. Ideally, the width of the dropdowns should be the same with as md-select component, or at least be able to grab styles from the select.component.scss file.

For example, I've had to add this to the select.component.ts file:

style-workaround

I should be adding these styles to the select.component.scss file like this instead, but it doesn't do anything.

style

Is there a better way to have custom widths or get the dropdown widths to match the width of the select component?