From 59ad3d2dc8553230a6eb9d1ecf28d58c74ac1bef Mon Sep 17 00:00:00 2001 From: pmartin Date: Mon, 2 Oct 2017 21:29:40 +0200 Subject: [PATCH] Sidenav design --- src/app/app.component.html | 53 ++++++++++++++------------------------ src/app/app.component.ts | 29 ++++++++++++++++++++- src/app/app.module.ts | 5 ++-- src/styles.scss | 50 ++++++++++++++++++++++++++++++----- 4 files changed, 94 insertions(+), 43 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 3635b98e..46c4151c 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,37 +1,24 @@ - +
+ + menu + + RxJS Docs - - - - - - - - - - - - - - - - -
- -
- + + + + + {{menu.title}} + + + +
+ +
+
+
\ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7d943bc9..55a562c0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,37 @@ import { Component } from '@angular/core'; +class Menu { + title: string; + link: string; + options: { exact: boolean }; +} + @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { - title = 'app'; + menus: Menu[] = [ + { + title: 'Home', + link: '/', + options: { exact: true } + }, + { + title: 'Operators', + link: '/operators', + options: { exact: false } + }, + { + title: 'Companies', + link: '/companies', + options: { exact: false } + }, + { + title: 'Team', + link: '/team', + options: { exact: false } + } + ] } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ac47ce51..0c5f249a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,7 +1,7 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { MdToolbarModule, MdSidenavModule, MdIconModule, MdButtonModule } from '@angular/material'; +import { MdToolbarModule, MdSidenavModule, MdIconModule, MdButtonModule, MdListModule } from '@angular/material'; import { RouterModule } from '@angular/router'; import { RXJS_DOC_ROUTES } from './app.routing'; @@ -27,7 +27,8 @@ import { RxjsComponent } from './rxjs/rxjs.component'; MdToolbarModule, MdSidenavModule, MdIconModule, - MdButtonModule + MdButtonModule, + MdListModule ], providers: [], bootstrap: [AppComponent] diff --git a/src/styles.scss b/src/styles.scss index 8bcf8b40..994f6f15 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,10 +1,46 @@ -@import '~@angular/material/prebuilt-themes/indigo-pink.css'; +@import "~@angular/material/theming"; +@include mat-core(); + +// Define the theme. +$primary: mat-palette($mat-indigo); +$accent: mat-palette($mat-pink); +$theme: mat-light-theme($primary, $accent); +@include angular-material-theme($theme); body { - font-family: Roboto; - margin: 0px; - } + font-family: Roboto, sans-serif; +} + +html, body { + margin: 0; + width: 100%; + height: 100%; +} + +.app-fullpage { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: flex; + flex-direction: column; +} + +md-sidenav-container { + flex: 1 1 auto; + width: 100%; + height: 100%; +} + +md-sidenav { + width: 200px; +} + +md-sidenav a.active .mat-list-item-content { + color: mat-color($accent); +} - .body-margin { - margin: 50px; - } +.body-margin { + margin: 50px; +}