File tree Expand file tree Collapse file tree 6 files changed +73
-8
lines changed Expand file tree Collapse file tree 6 files changed +73
-8
lines changed Original file line number Diff line number Diff line change 11
22@import ' variables' ;
33@import ' elevation' ;
4+ @import ' mixins' ;
45
56// TODO(jelbourn): This goes away.
67@import ' default-theme' ;
@@ -34,12 +35,7 @@ $md-mini-fab-padding: 8px !default;
3435 position : relative ;
3536
3637 // Reset browser <button> styles.
37- background : transparent ;
38- text-align : center ;
39- cursor : pointer ;
40- user-select : none ;
41- outline : none ;
42- border : none ;
38+ @include md-button-reset ();
4339
4440 // Make anchors render like buttons.
4541 display : inline-block ;
@@ -52,6 +48,7 @@ $md-mini-fab-padding: 8px !default;
5248 font-family : $md-font-family ;
5349 font-weight : 500 ;
5450 color : currentColor ;
51+ text-align : center ;
5552
5653 // Sizing.
5754 margin : $md-button-margin ;
Original file line number Diff line number Diff line change 1+ < div class ="md-menu ">
2+ < ng-content > </ ng-content >
3+ </ div >
4+
Original file line number Diff line number Diff line change 1+ // TODO(kara): update vars for desktop when MD team responds
2+
3+ @import ' variables' ;
4+ @import ' elevation' ;
5+ @import ' default-theme' ;
6+ @import ' mixins' ;
7+
8+ // menu width must be a multiple of 56px
9+ $md-menu-overlay-min-width : 112px !default ; // 56 * 2
10+ $md-menu-overlay-max-width : 280px !default ; // 56 * 5
11+
12+ $md-menu-overlay-max-height : calc (100vh + $md-menu-item-height ) !default ;
13+ $md-menu-item-height : 48px !default ;
14+ $md-menu-font-size : 16px !default ;
15+ $md-menu-side-padding : 16px !default ;
16+
17+ .md-menu {
18+ @include md-elevation (2 );
19+ min-width : $md-menu-overlay-min-width ;
20+ max-width : $md-menu-overlay-max-width ;
21+ max-height : $md-menu-overlay-max-height ;
22+
23+ background : md-color ($md-background , ' background' );
24+ }
25+
26+ [md-menu-item ] {
27+ @include md-button-reset ();
28+
29+ display : block ;
30+ width : 100% ;
31+ height : $md-menu-item-height ;
32+ padding : 0 $md-menu-side-padding ;
33+
34+ font-size : $md-menu-font-size ;
35+ font-family : $md-font-family ;
36+ text-align : start ;
37+ color : md-color ($md-foreground , ' text' );
38+
39+ & [disabled ] {
40+ color : md-color ($md-foreground , ' disabled' );
41+ }
42+
43+ & :hover:not ([disabled ]) {
44+ background : md-color ($md-background , ' hover' );
45+ }
46+ }
47+
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ import {Component, ViewEncapsulation} from '@angular/core';
55 selector : 'md-menu' ,
66 templateUrl : 'menu.html' ,
77 styleUrls : [ 'menu.css' ] ,
8- encapsulation : ViewEncapsulation . None
8+ encapsulation : ViewEncapsulation . None ,
9+ exportAs : 'mdMenu'
910} )
1011export class MdMenu { }
1112
Original file line number Diff line number Diff line change 3838 }
3939}
4040
41+ /* *
42+ * This mixin overrides default button styles like the gray background,
43+ * the border, and the outline.
44+ */
45+ @mixin md-button-reset {
46+ background : transparent ;
47+ cursor : pointer ;
48+ user-select : none ;
49+ outline : none ;
50+ border : none ;
51+ }
52+
4153/* *
4254 * A mixin, which generates temporary ink ripple on a given component.
4355 * When $bindToParent is set to true, it will check for the focused class on the same selector as you included
Original file line number Diff line number Diff line change 1- menu
1+ < md-menu >
2+ < button md-menu-item > Refresh</ button >
3+ < button md-menu-item > Settings</ button >
4+ < button md-menu-item disabled > Help</ button >
5+ </ md-menu >
You can’t perform that action at this time.
0 commit comments