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

Commit bbf4d82

Browse files
committed
refactor(): remove md-theme-level
1 parent e2c50a8 commit bbf4d82

File tree

3 files changed

+5
-48
lines changed

3 files changed

+5
-48
lines changed

docs/config/template/index.template.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
md-component-id="left"
2222
md-is-locked-open="$media('md')">
2323

24-
<md-toolbar md-theme-levels="{ backgroundColor: 900 }" style="min-height: 64px; max-height:64px;" layout="column">
24+
<md-toolbar style="min-height: 64px; max-height:64px;" layout="column">
2525
<h1 class="md-toolbar-tools" flex layout="column">
26-
<a href="" ng-click="goHome()" layout="row" flex>
26+
<a href="#/" ng-click="goHome()" layout="row" flex>
2727
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve" style="
2828
width: 40px; height: 40px;">
2929
<path d="M 50 0 L 100 14 L 92 80 L 50 100 L 8 80 L 0 14 Z" fill="#b2b2b2"></path>
30-
<path d="M 50 5 L 6 18 L 13.5 77 L 50 94 Z" fill="#E42939" md-theme-levels="{ fill: 700 }"></path>
31-
<path d="M 50 5 L 94 18 L 86.5 77 L 50 94 Z" fill="#B72833" md-theme-levels="{ fill: 900 }"></path>
30+
<path d="M 50 5 L 6 18 L 13.5 77 L 50 94 Z" fill="#E42939"></path>
31+
<path d="M 50 5 L 94 18 L 86.5 77 L 50 94 Z" fill="#B72833"></path>
3232
<path d="M 50 7 L 83 75 L 72 75 L 65 59 L 50 59 L 50 50 L 61 50 L 50 26 Z" fill="#b2b2b2"></path>
3333
<path d="M 50 7 L 17 75 L 28 75 L 35 59 L 50 59 L 50 50 L 39 50 L 50 26 Z" fill="#fff"></path>
3434
</svg>
@@ -62,7 +62,7 @@ <h1 class="md-toolbar-tools" flex layout="column">
6262
</md-sidenav>
6363

6464
<div layout="column" layout-fill tabIndex="-1" role="main">
65-
<md-toolbar md-theme-levels="{ backgroundColor: 900 }" layout="column">
65+
<md-toolbar layout="column">
6666
<div class="md-toolbar-tools" ng-click="openMenu()" flex layout="column">
6767
<div layout="row" flex>
6868
<button class="menu-icon" show hide-gt-md aria-label="Toggle Menu" style="position: relative; top: -5px;">

src/core/services/theming/theming.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
angular.module('material.core')
66
.directive('mdTheme', ThemingDirective)
77
.directive('mdThemable', ThemableDirective)
8-
.directive('mdThemeLevels', ThemeLevelsDirective)
98
.provider('$mdTheming', ThemingProvider);
109

1110
/**
@@ -101,40 +100,6 @@ function ThemingProvider() {
101100
}
102101
}
103102

104-
function ThemeLevelsDirective($window, $mdTheming) {
105-
var lookup = {},
106-
dummyElement = angular.element('<div>'),
107-
body = angular.element(document.body);
108-
109-
return function (scope, element, attr) {
110-
var styles = scope.$eval(attr.mdThemeLevels),
111-
themeName;
112-
angular.forEach(styles, function (value, key) {
113-
styles[key] = getColor(value);
114-
});
115-
element.css(styles);
116-
$mdTheming(element);
117-
themeName = element.controller('mdTheme').$mdTheme;
118-
function getColor(level) {
119-
//-- get or create theme
120-
var theme = lookup[themeName],
121-
color;
122-
if (!theme) theme = lookup[themeName] = {};
123-
//-- attempt to get color
124-
color = theme[level];
125-
//-- if color has been found already, return it
126-
if (color) return color;
127-
//-- otherwise, use the dummy DOM element to find it
128-
element.append(dummyElement);
129-
$mdTheming(dummyElement);
130-
dummyElement.attr('md-color-level', level);
131-
theme[level] = color = $window.getComputedStyle(dummyElement[0]).color;
132-
dummyElement.remove();
133-
return color;
134-
}
135-
};
136-
}
137-
138103
function ThemingDirective($interpolate) {
139104
return {
140105
priority: 100,

src/core/style/theme-levels.scss

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)