Skip to content

Commit c285d15

Browse files
committed
Address comments
1 parent acfa1be commit c285d15

File tree

8 files changed

+28
-22
lines changed

8 files changed

+28
-22
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import '@angular/material/core/theming/all-theme';
2+
3+
// Include core material styles.
4+
@include mat-core();
5+
6+
$primary: mat-palette($mat-indigo);
7+
$accent: mat-palette($mat-pink);
8+
9+
$light-theme: mat-light-theme($primary, $accent);
10+
$dark-theme: mat-dark-theme($primary, $accent);
11+
12+
@include angular-material-theme($light-theme);
13+
14+
.demo-dark-theme {
15+
@include angular-material-theme($dark-theme);
16+
}

src/demo-app/demo-app/demo-app.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
// The default indigo-pink theme will load through the index file. This makes the SCSS build faster
2-
// since Sass doesn't need to build a "prebuilt" theme again.
3-
@import '../../lib/core/theming/all-theme';
4-
5-
.demo-dark-theme {
6-
// Include core material styles.
7-
@include mat-core();
8-
9-
$primary: mat-palette($mat-indigo);
10-
$accent: mat-palette($mat-pink);
11-
$dark-theme: mat-dark-theme($primary, $accent);
12-
13-
// Include component styles with the given theme.
14-
@include angular-material-theme($dark-theme);
15-
}
16-
171
body {
182
font-family: Roboto, 'Helvetica Neue', sans-serif;
193

src/demo-app/demo-app/demo-app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class Home {}
1515
selector: 'demo-app',
1616
providers: [],
1717
templateUrl: 'demo-app.html',
18-
styleUrls: ['demo-app.css'],
18+
styleUrls: ['demo-app.css', 'demo-app-theme.css'],
1919
encapsulation: ViewEncapsulation.None,
2020
})
2121
export class DemoApp {

src/demo-app/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
<link rel="icon" type="image/x-icon" href="favicon.ico">
1010
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
11-
<link href="@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
1211

1312
<!-- FontAwesome for md-icon demo. -->
1413
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

tools/gulp/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export const SASS_AUTOPREFIXER_OPTIONS = {
1717
cascade: false,
1818
};
1919

20+
export const SASS_PREPROCESSOR_OPTIONS = {
21+
includePaths: [DIST_ROOT]
22+
};
23+
2024
export const HTML_MINIFIER_OPTIONS = {
2125
collapseWhitespace: true,
2226
removeComments: true,

tools/gulp/task_helpers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import * as fs from 'fs';
33
import * as gulp from 'gulp';
44
import * as path from 'path';
55

6-
import {NPM_VENDOR_FILES, PROJECT_ROOT, DIST_ROOT, SASS_AUTOPREFIXER_OPTIONS} from './constants';
6+
import {
7+
NPM_VENDOR_FILES, PROJECT_ROOT, DIST_ROOT, SASS_AUTOPREFIXER_OPTIONS,
8+
SASS_PREPROCESSOR_OPTIONS
9+
} from './constants';
710

811

912
/** Those imports lack typings. */
@@ -44,7 +47,7 @@ export function sassBuildTask(dest: string, root: string) {
4447
return () => {
4548
return gulp.src(_globify(root, '**/*.scss'))
4649
.pipe(gulpSourcemaps.init())
47-
.pipe(gulpSass().on('error', gulpSass.logError))
50+
.pipe(gulpSass(SASS_PREPROCESSOR_OPTIONS).on('error', gulpSass.logError))
4851
.pipe(gulpAutoprefixer(SASS_AUTOPREFIXER_OPTIONS))
4952
.pipe(gulpSourcemaps.write('.'))
5053
.pipe(gulp.dest(dest));

tools/gulp/tasks/aot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ task('aot:copy', [':build:devapp:scss', ':build:devapp:assets']);
1212
*/
1313
task('aot:prepare', sequenceTask(
1414
'clean',
15-
['aot:copy', 'build:components:release', ':build:components:ngc'])
15+
['build:components:release', 'aot:copy', ':build:components:ngc'])
1616
);
1717

1818
/** Builds the demo-app with the Angular compiler to verify that all components work. */

tools/gulp/tasks/development.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ task(':watch:devapp', () => {
2020

2121
task(':build:devapp:vendor', vendorTask());
2222
task(':build:devapp:ts', tsBuildTask(appDir));
23-
task(':build:devapp:scss', sassBuildTask(outDir, appDir));
23+
task(':build:devapp:scss', [':build:components:scss'], sassBuildTask(outDir, appDir));
2424
task(':build:devapp:assets', copyTask(appDir, outDir));
2525
task('build:devapp', buildAppTask('devapp'));
2626

0 commit comments

Comments
 (0)