OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --><html><head><link rel="import" href="../polymer/polymer.html"> | 9 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 10 <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> |
10 <link rel="import" href="../iron-menu-behavior/iron-menu-behavior.html"> | 11 <link rel="import" href="../iron-menu-behavior/iron-menu-behavior.html"> |
11 <link rel="import" href="../paper-styles/paper-styles.html"> | 12 <link rel="import" href="../paper-styles/default-theme.html"> |
| 13 <link rel="import" href="paper-menu-shared-styles.html"> |
12 | 14 |
13 <!-- | 15 <!-- |
| 16 Material design: [Menus](https://www.google.com/design/spec/components/menus.htm
l) |
| 17 |
14 `<paper-menu>` implements an accessible menu control with Material Design stylin
g. The focused item | 18 `<paper-menu>` implements an accessible menu control with Material Design stylin
g. The focused item |
15 is highlighted, and the selected item has bolded text. | 19 is highlighted, and the selected item has bolded text. |
16 | 20 |
17 <paper-menu> | 21 <paper-menu> |
18 <paper-item>Item 1</paper-item> | 22 <paper-item>Item 1</paper-item> |
19 <paper-item>Item 2</paper-item> | 23 <paper-item>Item 2</paper-item> |
20 </paper-menu> | 24 </paper-menu> |
21 | 25 |
22 An initial selection can be specified with the `selected` attribute. | 26 An initial selection can be specified with the `selected` attribute. |
23 | 27 |
(...skipping 10 matching lines...) Expand all Loading... |
34 <paper-item>Item 2</paper-item> | 38 <paper-item>Item 2</paper-item> |
35 </paper-menu> | 39 </paper-menu> |
36 | 40 |
37 ### Styling | 41 ### Styling |
38 | 42 |
39 The following custom properties and mixins are available for styling: | 43 The following custom properties and mixins are available for styling: |
40 | 44 |
41 Custom property | Description | Default | 45 Custom property | Description | Default |
42 ----------------|-------------|---------- | 46 ----------------|-------------|---------- |
43 `--paper-menu-background-color` | Menu background color
| `--primary-background-color` | 47 `--paper-menu-background-color` | Menu background color
| `--primary-background-color` |
44 `--paper-menu-color` | Menu foreground color
| `--primary-text-color` | 48 `--paper-menu-color` | Menu foreground color
| `--primary-text-color` |
45 `--paper-menu-disabled-color` | Foreground color for a disabled item
| `--disabled-text-color` | 49 `--paper-menu-disabled-color` | Foreground color for a disabled item
| `--disabled-text-color` |
46 `--paper-menu` | Mixin applied to the menu
| `{}` | 50 `--paper-menu` | Mixin applied to the menu
| `{}` |
47 `--paper-menu-selected-item` | Mixin applied to the selected item
| `{}` | 51 `--paper-menu-selected-item` | Mixin applied to the selected item
| `{}` |
48 `--paper-menu-focused-item` | Mixin applied to the focused item
| `{}` | 52 `--paper-menu-focused-item` | Mixin applied to the focused item
| `{}` |
49 `--paper-menu-focused-item-after` | Mixin applied to the ::after pseudo-element
for the focused item | `{}` | 53 `--paper-menu-focused-item-after` | Mixin applied to the ::after pseudo-element
for the focused item | `{}` |
50 | 54 |
51 ### Accessibility | 55 ### Accessibility |
52 | 56 |
53 `<paper-menu>` has `role="menu"` by default. A multi-select menu will also have | 57 `<paper-menu>` has `role="menu"` by default. A multi-select menu will also have |
54 `aria-multiselectable` set. It implements key bindings to navigate through the m
enu with the up and | 58 `aria-multiselectable` set. It implements key bindings to navigate through the m
enu with the up and |
55 down arrow keys, esc to exit the menu, and enter to activate a menu item. Typing
the first letter | 59 down arrow keys, esc to exit the menu, and enter to activate a menu item. Typing
the first letter |
56 of a menu item will also focus it. | 60 of a menu item will also focus it. |
57 | 61 |
58 @group Paper Elements | 62 @group Paper Elements |
59 @element paper-menu | 63 @element paper-menu |
60 @hero hero.svg | 64 @hero hero.svg |
61 @demo demo/index.html | 65 @demo demo/index.html |
62 --> | 66 --> |
63 | 67 |
64 </head><body><dom-module id="paper-menu"> | 68 </head><body><dom-module id="paper-menu"> |
65 <link rel="import" type="css" href="paper-menu-shared.css"> | 69 <template> |
| 70 <style include="paper-menu-shared-styles"></style> |
| 71 <style> |
| 72 :host { |
| 73 display: block; |
| 74 padding: 8px 0; |
66 | 75 |
67 <style> | 76 background: var(--paper-menu-background-color, --primary-background-colo
r); |
68 :host { | 77 color: var(--paper-menu-color, --primary-text-color); |
69 display: block; | |
70 padding: 8px 0; | |
71 | 78 |
72 background: var(--paper-menu-background-color, --primary-background-color)
; | 79 @apply(--paper-menu); |
73 color: var(--paper-menu-color, --primary-text-color); | 80 } |
74 | 81 </style> |
75 @apply(--paper-menu); | |
76 } | |
77 </style> | |
78 <template> | |
79 | 82 |
80 <div class="selectable-content"> | 83 <div class="selectable-content"> |
81 <content></content> | 84 <content></content> |
82 </div> | 85 </div> |
83 | |
84 </template> | 86 </template> |
85 | 87 |
86 </dom-module> | 88 </dom-module> |
87 | |
88 <script src="paper-menu-extracted.js"></script></body></html> | 89 <script src="paper-menu-extracted.js"></script></body></html> |
OLD | NEW |