Fix OOP <webview> resize and autosize.
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / paper-drawer-panel / paper-drawer-panel.html
blobe3349992a0bd8a97d90e6109c39cfdb6234eab06
1 <!--
2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 --><html><head><link rel="import" href="../polymer/polymer.html">
9 <link rel="import" href="../iron-media-query/iron-media-query.html">
10 <link rel="import" href="../iron-selector/iron-selector.html">
12 <!--
13 `paper-drawer-panel` contains a drawer panel and a main panel. The drawer
14 and the main panel are side-by-side with drawer on the left. When the browser
15 window size is smaller than the `responsiveWidth`, `paper-drawer-panel`
16 changes to narrow layout. In narrow layout, the drawer will be stacked on top
17 of the main panel. The drawer will slide in/out to hide/reveal the main
18 panel.
20 Use the attribute `drawer` to indicate that the element is the drawer panel and
21 `main` to indicate that the element is the main panel.
23 Example:
25 <paper-drawer-panel>
26 <div drawer> Drawer panel... </div>
27 <div main> Main panel... </div>
28 </paper-drawer-panel>
30 The drawer and the main panels are not scrollable. You can set CSS overflow
31 property on the elements to make them scrollable or use `paper-header-panel`.
33 Example:
35 <paper-drawer-panel>
36 <paper-header-panel drawer>
37 <paper-toolbar></paper-toolbar>
38 <div> Drawer content... </div>
39 </paper-header-panel>
40 <paper-header-panel main>
41 <paper-toolbar></paper-toolbar>
42 <div> Main content... </div>
43 </paper-header-panel>
44 </paper-drawer-panel>
46 An element that should toggle the drawer will automatically do so if it's
47 given the `paper-drawer-toggle` attribute. Also this element will automatically
48 be hidden in wide layout.
50 Example:
52 <paper-drawer-panel>
53 <paper-header-panel drawer>
54 <paper-toolbar>
55 <div>Application</div>
56 </paper-toolbar>
57 <div> Drawer content... </div>
58 </paper-header-panel>
59 <paper-header-panel main>
60 <paper-toolbar>
61 <paper-icon-button icon="menu" paper-drawer-toggle></paper-icon-button>
62 <div>Title</div>
63 </paper-toolbar>
64 <div> Main content... </div>
65 </paper-header-panel>
66 </paper-drawer-panel>
68 To position the drawer to the right, add `right-drawer` attribute.
70 <paper-drawer-panel right-drawer>
71 <div drawer> Drawer panel... </div>
72 <div main> Main panel... </div>
73 </paper-drawer-panel>
75 Styling `paper-drawer-panel`
77 To change the main container:
79 paper-drawer-panel {
80 --paper-drawer-panel-main-container: {
81 background-color: gray;
85 To change the drawer container when it's in the left side:
87 paper-drawer-panel {
88 --paper-drawer-panel-left-drawer-container: {
89 background-color: white;
93 To change the drawer container when it's in the right side:
95 paper-drawer-panel {
96 --paper-drawer-panel-right-drawer-container: {
97 background-color: white;
101 @group Paper elements
102 @element paper-drawer-panel
103 @demo demo/index.html
104 @hero hero.svg
107 </head><body><dom-module id="paper-drawer-panel">
108 <link rel="import" type="css" href="paper-drawer-panel.css">
110 <template>
111 <iron-media-query id="mq" on-query-matches-changed="_onQueryMatchesChanged" query="[[_computeMediaQuery(forceNarrow, responsiveWidth)]]">
112 </iron-media-query>
114 <iron-selector attr-for-selected="id" class$="[[_computeIronSelectorClass(narrow, transition, dragging, rightDrawer, peeking)]]" activate-event="" selected="[[selected]]">
116 <div id="main" style$="[[_computeMainStyle(narrow, rightDrawer, drawerWidth)]]">
117 <content select="[main]"></content>
118 <div id="scrim" on-tap="closeDrawer"></div>
119 </div>
121 <div id="drawer" style$="[[_computeDrawerStyle(drawerWidth)]]">
122 <content select="[drawer]"></content>
123 </div>
125 </iron-selector>
126 </template>
128 </dom-module>
130 <script src="paper-drawer-panel-extracted.js"></script></body></html>