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

fix(theme): prepend # to hex codes enableBrowserColor #11492

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/services/theming/theming.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
PALETTES[THEMES[theme].colors[options.palette || 'primary'].name];

var color = angular.isObject(palette[hue]) ? palette[hue].hex : palette[hue];
if (color.substr(0, 1) !== '#') color = '#' + color;

return setBrowserColor(color);
};
Expand Down
6 changes: 3 additions & 3 deletions src/core/services/theming/theming.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ describe('$mdThemingProvider', function() {

it('should use default primary color at the meta tag', function () {
var name = 'theme-color';
var content = themingProvider._PALETTES.testPalette['800'].hex;
var content = '#' + themingProvider._PALETTES.testPalette['800'].hex;

expect(document.getElementsByName(name).length).toBe(0);

Expand All @@ -378,7 +378,7 @@ describe('$mdThemingProvider', function() {

var hue = '200';

var content = themingProvider._PALETTES.testPalette[hue].hex;
var content = '#' + themingProvider._PALETTES.testPalette[hue].hex;

expect(document.getElementsByName(name).length).toBe(0);

Expand All @@ -404,7 +404,7 @@ describe('$mdThemingProvider', function() {
it('should use test theme', function () {
var name = 'theme-color';

var content = themingProvider._PALETTES.testPalette['800'].hex;
var content = '#' + themingProvider._PALETTES.testPalette['800'].hex;

expect(document.getElementsByName(name).length).toBe(0);

Expand Down