Skip to content

Commit f138682

Browse files
mmalerbaandrewseguin
authored andcommitted
demo(prerender): add theme to prerender demo (#13516)
1 parent c4a422a commit f138682

File tree

4 files changed

+35
-12
lines changed

4 files changed

+35
-12
lines changed

src/universal-app/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Angular Material Universal Kitchen Sink Test</title>
7+
<link href="theme.css" rel="stylesheet">
8+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
9+
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
610
<base href="/">
711
</head>
812
<body>

src/universal-app/kitchen-sink/kitchen-sink.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ <h2>Autocomplete</h2>
1010
<h2>Button</h2>
1111

1212
<button mat-button>go</button>
13-
<button mat-icon-button>go</button>
13+
<button mat-icon-button><mat-icon>search</mat-icon></button>
1414
<button mat-raised-button>go</button>
15-
<button mat-fab>go</button>
16-
<button mat-mini-fab>go</button>
15+
<button mat-fab><mat-icon>home</mat-icon></button>
16+
<button mat-mini-fab><mat-icon>favorite</mat-icon></button>
1717

1818
<a mat-button href="https://google.com">Google</a>
19-
<a mat-icon-button href="https://google.com">Google</a>
19+
<a mat-icon-button href="https://google.com"><mat-icon>search</mat-icon></a>
2020
<a mat-raised-button href="https://google.com">Google</a>
21-
<a mat-fab href="https://google.com">Google</a>
22-
<a mat-mini-fab href="https://google.com">Google</a>
21+
<a mat-fab href="https://google.com"><mat-icon>home</mat-icon></a>
22+
<a mat-mini-fab href="https://google.com"><mat-icon>favorite</mat-icon></a>
2323

2424
<h2>Button toggle</h2>
2525

@@ -107,7 +107,7 @@ <h2>Grid list</h2>
107107
</mat-grid-list>
108108

109109
<h2>Icon</h2>
110-
<mat-icon>ligature</mat-icon>
110+
<mat-icon>grade</mat-icon>
111111

112112
<h2>Input</h2>
113113

@@ -361,6 +361,6 @@ <h2>Focus trap</h2>
361361

362362
<h2>Badge</h2>
363363

364-
<button mat-raised-button matBadge="Clicked 1337 times">
364+
<button mat-raised-button matBadge="99">
365365
Clicky thing
366366
</button>

src/universal-app/theme.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import '../lib/core/theming/all-theme';
2+
3+
// Plus imports for other components in your app.
4+
5+
// Include the common styles for Angular Material. We include this here so that you only
6+
// have to load a single css file for Angular Material in your app.
7+
// **Be sure that you only ever include this mixin once!**
8+
@include mat-core();
9+
10+
// Define the default theme (same as the example above).
11+
$candy-app-primary: mat-palette($mat-indigo);
12+
$candy-app-accent: mat-palette($mat-pink, A200, A100, A400);
13+
$candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent);
14+
15+
// Include the default theme styles.
16+
@include angular-material-theme($candy-app-theme);

tools/gulp/tasks/universal.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {task} from 'gulp';
1+
import {dest, task} from 'gulp';
22
import {ngcBuildTask, tsBuildTask, copyTask, execTask} from '../util/task_helpers';
33
import {join} from 'path';
44
import {copySync} from 'fs-extra';
5-
import {buildConfig, sequenceTask} from 'material2-build-tools';
5+
import {buildConfig, buildScssPipeline, sequenceTask} from 'material2-build-tools';
66

77
const {outputDir, packagesDir} = buildConfig;
88

@@ -36,13 +36,16 @@ task('universal:build', sequenceTask(
3636
'clean',
3737
['material:build-release', 'cdk:build-release'],
3838
['universal:copy-release', 'universal:copy-files'],
39-
'universal:build-app-ts',
40-
'universal:build-prerender-ts'
39+
['universal:build-app-ts', 'universal:build-app-scss'],
40+
'universal:build-prerender-ts',
4141
));
4242

4343
/** Task that builds the universal app in the output directory. */
4444
task('universal:build-app-ts', ngcBuildTask(tsconfigAppPath));
4545

46+
/** Task that builds the universal app styles in the output directory. */
47+
task('universal:build-app-scss', () => buildScssPipeline(appDir).pipe(dest(outDir)));
48+
4649
/** Task that copies all files to the output directory. */
4750
task('universal:copy-files', copyTask(appDir, outDir));
4851

0 commit comments

Comments
 (0)