This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +59
-22
lines changed Expand file tree Collapse file tree 3 files changed +59
-22
lines changed Original file line number Diff line number Diff line change 157
157
}
158
158
159
159
160
- ._md a .md-THEME_NAME-theme :not (.md-button ) {
161
- & .md-primary {
162
- color : ' {{primary-color}}' ;
160
+ ._md {
161
+ a .md-THEME_NAME-theme :not (.md-button ) {
162
+ & .md-primary {
163
+ color : ' {{primary-color}}' ;
163
164
164
- & :hover {
165
- color : ' {{primary-700}}' ;
165
+ & :hover {
166
+ color : ' {{primary-700}}' ;
167
+ }
166
168
}
167
- }
168
-
169
- & .md-accent {
170
- color : ' {{accent-color}}' ;
171
169
172
- & :hover {
173
- color : ' {{accent-700}}' ;
170
+ & .md-accent {
171
+ color : ' {{accent-color}}' ;
172
+
173
+ & :hover {
174
+ color : ' {{accent-700}}' ;
175
+ }
174
176
}
175
- }
176
177
177
- & .md-accent {
178
- color : ' {{accent-color}}' ;
178
+ & .md-accent {
179
+ color : ' {{accent-color}}' ;
179
180
180
- & :hover {
181
- color : ' {{accent-A700}}' ;
181
+ & :hover {
182
+ color : ' {{accent-A700}}' ;
183
+ }
182
184
}
183
- }
184
185
185
- & .md-warn {
186
- color : ' {{warn-color}}' ;
186
+ & .md-warn {
187
+ color : ' {{warn-color}}' ;
187
188
188
- & :hover {
189
- color : ' {{warn-700}}' ;
189
+ & :hover {
190
+ color : ' {{warn-700}}' ;
191
+ }
190
192
}
191
193
}
192
194
}
Original file line number Diff line number Diff line change 7
7
*/
8
8
angular
9
9
. module ( 'material.components.button' , [ 'material.core' ] )
10
- . directive ( 'mdButton' , MdButtonDirective ) ;
10
+ . directive ( 'mdButton' , MdButtonDirective )
11
+ . directive ( 'a' , MdAnchorDirective ) ;
12
+
13
+
14
+ /**
15
+ * @ngdoc directive
16
+ * @name a
17
+ * @module material.components.button
18
+ *
19
+ * @restrict E
20
+ *
21
+ * @description
22
+ * `a` is a anchnor directive used to inherit theme so stand-alone anchors.
23
+ * This allows standalone `a` tags to support theme colors for md-primary, md-accent, etc.
24
+ *
25
+ * @usage
26
+ *
27
+ * <hljs lang="html">
28
+ * <md-content md-theme="myTheme">
29
+ * <a href="#chapter1" class="md-accent"></a>
30
+ * </md-content>
31
+ * </hljs>
32
+ */
33
+ function MdAnchorDirective ( $mdTheming ) {
34
+ return {
35
+ restrict : 'E' ,
36
+ link : function postLink ( scope , element ) {
37
+ // Make sure to inherit theme so stand-alone anchors
38
+ // support theme colors for md-primary, md-accent, etc.
39
+ $mdTheming ( element ) ;
40
+ }
41
+ } ;
42
+ }
43
+
11
44
12
45
/**
13
46
* @ngdoc directive
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ var GENERATED = { };
63
63
var PALETTES ;
64
64
var THEMES ;
65
65
66
+ // Text Colors on light and dakr backgrounds
67
+ // @see https://www.google.com/design/spec/style/color.html#color-text-background-colors
66
68
var DARK_FOREGROUND = {
67
69
name : 'dark' ,
68
70
'1' : 'rgba(0,0,0,0.87)' ,
You can’t perform that action at this time.
0 commit comments