In my sidebar, there is a select
element. When the sidebar collapses, all elements are replaced with icons. I want the select to only display the arrow button at that point while maintaining a minimum width and avoiding any unnecessary white space around it. Is there a way to achieve this without hiding the button completely?
Markup:
<select [ngClass]="{'account-selector': !sidebarCollapsed, 'account-selector-collapsed': sidebarCollapsed}" [(ngModel)]="selectedAccount" (change)="setSelectedAccount()">
<option *ngFor="let account of accounts" [ngValue]="account" [selected]="account === selectedAccount">{{account.data.Name}}</option>
</select>
CSS:
.account-selector {
max-width: 90%;
}
.account-selector-collapsed {
// What should be included here?
}