Angular Material Navigation drawer — Adding support mode = “Rail” (mini variant behaviour)

UPDATE: Since writing this blog post and sharing it on Angular mini variant issue. I’ve published this as an NPM package https://www.npmjs.com/package/angular-material-rail-drawer

Since 2016, the Angular community has been shouting out of a mini variant for material design, including this article by Harkirat Singh which you can view here: Angular 6 — Mini-Variant Drawer. Unfortunately every version I’ve seen currently uses some form of *ngIf