Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit e7180db

Browse files
committed
Change default theme to indigo-pink
1 parent cfbc576 commit e7180db

File tree

8 files changed

+23
-11
lines changed

8 files changed

+23
-11
lines changed

browser-providers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const configuration = {
2626
'iOS7': { unitTest: {target: null}, e2e: {target: null}},
2727
'iOS8': { unitTest: {target: null}, e2e: {target: null}},
2828
'iOS9': { unitTest: {target: 'BS'}, e2e: {target: null}},
29-
'WindowsPhone': { unitTest: {target: 'BS'}, e2e: {target: null}}
29+
'WindowsPhone': { unitTest: {target: null}, e2e: {target: null}}
3030
};
3131

3232
exports.customLaunchers = {

src/app/pages/component-viewer/_component-viewer-theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
$background: map-get($theme, background);
88
$foreground: map-get($theme, foreground);
99

10+
guide-viewer,
1011
app-component-viewer {
1112
color: mat-color($foreground, text);
1213

src/app/pages/guide-list/guide-list.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import {async, TestBed, ComponentFixture} from '@angular/core/testing';
1+
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
33
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
4-
import {CommonModule} from '@angular/common';
54
import {RouterTestingModule} from '@angular/router/testing';
65
import {MaterialModule} from '@angular/material';
76

src/app/shared/theme-picker/theme-picker.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<md-menu class="docs-theme-picker-menu" #themeMenu="mdMenu" x-position="before">
77
<md-grid-list cols="2">
88
<md-grid-tile *ngFor="let theme of themes">
9-
<div md-menu-item (click)="installTheme(theme.href)">
9+
<div md-menu-item (click)="installTheme(theme)">
1010
<div class="docs-theme-picker-swatch">
1111
<md-icon class="docs-theme-chosen-icon" *ngIf="currentTheme === theme">check_circle</md-icon>
1212
<div class="docs-theme-picker-primary" [style.background]="theme.primary"></div>

src/app/shared/theme-picker/theme-picker.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ describe('ThemePicker', () => {
2222
const component = fixture.componentInstance;
2323
const href = 'pink-bluegrey.css';
2424
spyOn(component.styleManager, 'setStyle');
25-
component.installTheme(href);
25+
component.installTheme({
26+
primary: '#E91E63',
27+
accent: '#607D8B',
28+
href,
29+
});
2630
expect(component.styleManager.setStyle).toHaveBeenCalled();
2731
expect(component.styleManager.setStyle).toHaveBeenCalledWith('theme', `assets/${href}`);
2832
});

src/app/shared/theme-picker/theme-picker.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class ThemePicker {
2626
accent: '#E91E63',
2727
href: 'indigo-pink.css',
2828
isDark: false,
29+
isDefault: true,
2930
},
3031
{
3132
primary: '#E91E63',
@@ -47,13 +48,19 @@ export class ThemePicker {
4748
) {
4849
const currentTheme = this._themeStorage.getStoredTheme();
4950
if (currentTheme) {
50-
this.installTheme(currentTheme.href);
51+
this.installTheme(currentTheme);
5152
}
5253
}
5354

54-
installTheme(href: string) {
55-
this.currentTheme = this._getCurrentThemeFromHref(href);
56-
this.styleManager.setStyle('theme', `assets/${href}`);
55+
installTheme(theme: DocsSiteTheme) {
56+
this.currentTheme = this._getCurrentThemeFromHref(theme.href);
57+
58+
if (theme.isDefault) {
59+
this.styleManager.removeStyle('theme');
60+
} else {
61+
this.styleManager.setStyle('theme', `assets/${theme.href}`);
62+
}
63+
5764
if (this.currentTheme) {
5865
this._themeStorage.storeTheme(this.currentTheme);
5966
}

src/app/shared/theme-picker/theme-storage/theme-storage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface DocsSiteTheme {
55
accent: string;
66
primary: string;
77
isDark?: boolean;
8+
isDefault?: boolean;
89
};
910

1011

src/main.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212

1313
// Define the light theme.
14-
$primary: mat-palette($mat-cyan);
15-
$accent: mat-palette($mat-amber, A200, A100, A400);
14+
$primary: mat-palette($mat-indigo);
15+
$accent: mat-palette($mat-pink, A200, A100, A400);
1616

1717
$theme: mat-light-theme($primary, $accent);
1818
@include angular-material-theme($theme);

0 commit comments

Comments
 (0)