From 88535ee409cc804f05e5f8d1c02f0da32d568e6d Mon Sep 17 00:00:00 2001 From: David Donges <david.noah.donges@mni.thm.de> Date: Sun, 4 Mar 2018 20:26:12 +0100 Subject: [PATCH] Add angular material --- package-lock.json | 21 +++++++++++++++++++++ package.json | 5 ++++- src/app/app.module.ts | 4 +++- src/index.html | 2 ++ src/main.ts | 2 ++ src/styles.scss | 25 ++++++++++++++++++++++++- 6 files changed, 56 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e9ae999a1..13af54f77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,14 @@ "tslib": "1.9.0" } }, + "@angular/cdk": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-5.2.3.tgz", + "integrity": "sha512-o95vQCJ1FpHLQj/ZfIrOya/rK0S7VwiY5vjEivpFnH25kHF5LNT4LTj6BOFkPbClMHTIM2wdKwWnuTfK0bg9WA==", + "requires": { + "tslib": "1.9.0" + } + }, "@angular/cli": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-1.7.2.tgz", @@ -201,6 +209,14 @@ "integrity": "sha512-Tqd9ll6QBSKa2PKzhbyRiKfKZh4MOB6um3aiedC+m3IBB8zMgrY+EJbfP/SN52LsZdShEnLjuKcBZG0eqTjgEQ==", "dev": true }, + "@angular/material": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-5.2.3.tgz", + "integrity": "sha512-v6IGxGWaeALgBH8+kt2Q9K32zmJQH193bWdCeWmtXk0vJlj3NTiWYy+vLoZQ8aPIAtOqCKCmhf5VrerkS6pgww==", + "requires": { + "tslib": "1.9.0" + } + }, "@angular/platform-browser": { "version": "5.2.7", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-5.2.7.tgz", @@ -4732,6 +4748,11 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, + "hammerjs": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", + "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=" + }, "handle-thing": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", diff --git a/package.json b/package.json index 981cc0bdd..73938f802 100644 --- a/package.json +++ b/package.json @@ -12,16 +12,19 @@ }, "private": true, "dependencies": { - "@angular/animations": "^5.2.0", + "@angular/animations": "^5.2.7", + "@angular/cdk": "^5.2.3", "@angular/common": "^5.2.0", "@angular/compiler": "^5.2.0", "@angular/core": "^5.2.0", "@angular/forms": "^5.2.0", "@angular/http": "^5.2.0", + "@angular/material": "^5.2.3", "@angular/platform-browser": "^5.2.0", "@angular/platform-browser-dynamic": "^5.2.0", "@angular/router": "^5.2.0", "core-js": "^2.4.1", + "hammerjs": "^2.0.8", "rxjs": "^5.5.6", "zone.js": "^0.8.19" }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 926975afe..fc16c11f0 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,6 +3,7 @@ import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @NgModule({ @@ -10,7 +11,8 @@ import { AppComponent } from './app.component'; AppComponent ], imports: [ - BrowserModule + BrowserModule, + BrowserAnimationsModule ], providers: [], bootstrap: [AppComponent] diff --git a/src/index.html b/src/index.html index 8ea6aa465..5b215606d 100644 --- a/src/index.html +++ b/src/index.html @@ -7,6 +7,8 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> + <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet"> + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> </head> <body> <app-root></app-root> diff --git a/src/main.ts b/src/main.ts index 91ec6da5f..a7ea96c2d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,8 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import 'hammerjs'; + if (environment.production) { enableProdMode(); } diff --git a/src/styles.scss b/src/styles.scss index 90d4ee007..ecdf3ec29 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1 +1,24 @@ -/* You can add global styles to this file, and also import other style files */ +@import '~@angular/material/theming'; +// Plus imports for other components in your app. + +// Include the common styles for Angular Material. We include this here so that you only +// have to load a single css file for Angular Material in your app. +// Be sure that you only ever include this mixin once! +@include mat-core(); + +// Define the palettes for your theme using the Material Design palettes available in palette.scss +// (imported above). For each palette, you can optionally specify a default, lighter, and darker +// hue. Available color palettes: https://www.google.com/design/spec/style/color.html +$arsnova-primary: mat-palette($mat-teal); +$arsnova-accent: mat-palette($mat-blue-gray, A200, A100, A400); + +// The warn palette is optional (defaults to red). +$arsnova-warn: mat-palette($mat-red); + +// Create the theme object (a Sass map containing all of the palettes). +$arsnova-theme: mat-light-theme($arsnova-primary, $arsnova-accent, $arsnova-warn); + +// Include theme styles for core and each component used in your app. +// Alternatively, you can import and @include the theme mixins for each component +// that you are using. +@include angular-material-theme($arsnova-theme); -- GitLab