Skip to content

Commit

Permalink
Sass variable import improvement (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbert authored and lmmrssa committed Feb 27, 2018
1 parent b7ee5cd commit 0a06f76
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 50 deletions.
3 changes: 1 addition & 2 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"prefix": "app",
"styles": [
"../node_modules/material-design-icons/iconfont/material-icons.css",
"styles.scss",
"planet-mat-theme.scss"
"styles.scss"
],
"environmentSource": "environments/environment.ts",
"environments": {
Expand Down
33 changes: 29 additions & 4 deletions src/app/variables.scss → src/app/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
@import '~@angular/material/theming';

$primary-hue: 500;
$accent-hue: 500;
$warn-hue: 500;

$planet-primary: $mat-blue;
$planet-accent: $mat-amber;
$planet-warn: $mat-red;

$planet-app-primary: mat-palette($planet-primary, $primary-hue);
$planet-app-accent: mat-palette($planet-accent, $accent-hue);
$planet-app-warn: mat-palette($planet-warn, $warn-hue);

$planet-app-theme: mat-light-theme($planet-app-primary, $planet-app-accent, $planet-app-warn);

$primary: mat-color($planet-app-primary, $primary-hue);
$accent: mat-color($planet-app-accent, $accent-hue);
$primary-text: mat-contrast($planet-primary, $primary-hue);
$accent-text: mat-contrast($planet-accent, $accent-hue);
$light-grey: mat-color($mat-grey, 100);
$grey: mat-color($mat-grey, 400);
$primary-light: mat-color($planet-app-primary, 100);

$font-family: Roboto, sans-serif;

/*
* Old Planet Material Colors
* Saved in case we want to revert
* We can delete once UX finalizes colors
$ole-blue-light: rgb(76, 165, 211);
$ole-blue: rgb(42, 121, 200);
$ole-blue-dark: rgb(0, 62, 99);
Expand All @@ -13,10 +42,6 @@ $pending: #ed9121; // Dogi's WIP label color
$error-red: #a94442;
// $body-margin: 8px; we won't need to use this if we use bootstrap's container class
/*
* Old Planet Material Colors
* Saved in case we want to revert
* We can delete once UX finalizes colors
$planet-primary: (
50 : #e5eff8,
100 : #bfd7ef,
Expand Down
19 changes: 0 additions & 19 deletions src/app/courses/request-courses/courses-request.component.scss

This file was deleted.

3 changes: 1 addition & 2 deletions src/app/courses/request-courses/courses-request.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component } from '@angular/core';

@Component({
templateUrl: 'courses-request.component.html',
styleUrls: [ 'courses-request.component.scss' ]
templateUrl: 'courses-request.component.html'
})
export class CoursesRequestComponent {}
24 changes: 1 addition & 23 deletions src/planet-mat-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,7 @@
// 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();
@import './app/variables';

$primary-hue: 500;
$accent-hue: 500;
$warn-hue: 500;

$planet-primary: $mat-blue;
$planet-accent: $mat-amber;
$planet-warn: $mat-red;

$planet-app-primary: mat-palette($planet-primary, $primary-hue);
$planet-app-accent: mat-palette($planet-accent, $accent-hue);
$planet-app-warn: mat-palette($planet-warn, $warn-hue);

$planet-app-theme: mat-light-theme($planet-app-primary, $planet-app-accent, $planet-app-warn);

$primary: mat-color($planet-app-primary, $primary-hue);
$accent: mat-color($planet-app-accent, $accent-hue);
$primary-text: mat-contrast($planet-primary, $primary-hue);
$accent-text: mat-contrast($planet-accent, $accent-hue);
$light-grey: mat-color($mat-grey, 100);
$grey: mat-color($mat-grey, 400);
$primary-light: mat-color($planet-app-primary, 100);
@import './app/_variables';

@include angular-material-theme($planet-app-theme);

Expand Down

0 comments on commit 0a06f76

Please sign in to comment.