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=
"../paper-styles/paper-styles.html">
12 `paper-toolbar` is a horizontal bar containing items that can be used for
13 label, navigation, search and actions. The items place inside the
14 `paper-toolbar` are projected into a `class="horizontal center layout"` container inside of
15 `paper-toolbar`'s Shadow DOM. You can use flex attributes to control the items'
21 <paper-icon-button icon="menu" on-tap="menuAction"></paper-icon-button>
22 <div class="title">Title</div>
23 <paper-icon-button icon="more-vert" on-tap="moreAction"></paper-icon-button>
26 `paper-toolbar` has a standard height, but can made be taller by setting `tall`
27 class on the `paper-toolbar`. This will make the toolbar 3x the normal height.
29 <paper-toolbar class="tall">
30 <paper-icon-button icon="menu"></paper-icon-button>
33 Apply `medium-tall` class to make the toolbar medium tall. This will make the
34 toolbar 2x the normal height.
36 <paper-toolbar class="medium-tall">
37 <paper-icon-button icon="menu"></paper-icon-button>
40 When `tall`, items can pin to either the top (default), middle or bottom. Use
41 `middle` class for middle content and `bottom` class for bottom content.
43 <paper-toolbar class="tall">
44 <paper-icon-button icon="menu"></paper-icon-button>
45 <div class="middle title">Middle Title</div>
46 <div class="bottom title">Bottom Title</div>
49 For `medium-tall` toolbar, the middle and bottom contents overlap and are
50 pinned to the bottom. But `middleJustify` and `bottomJustify` attributes are
51 still honored separately.
53 To make an element completely fit at the bottom of the toolbar, use `fit` along
56 <paper-toolbar class="tall">
57 <div id="progressBar" class="bottom fit"></div>
62 The following custom properties and mixins are available for styling:
64 Custom property | Description | Default
65 ----------------|-------------|----------
66 `--paper-toolbar-background` | Toolbar background color | `--default-primary-color`
67 `--paper-toolbar-color` | Toolbar foreground color | `--text-primary-color`
68 `--paper-toolbar` | Mixin applied to the toolbar | `{}`
72 `<paper-toolbar>` has `role="toolbar"` by default. Any elements with the class `title` will
73 be used as the label of the toolbar via `aria-labelledby`.
78 </head><body><dom-module id=
"paper-toolbar">
85 box-sizing: border-box;
86 -moz-box-sizing: border-box;
91 background: var(--paper-toolbar-background, --default-primary-color);
92 color: var(--paper-toolbar-color, --text-primary-color);
94 @apply(--paper-toolbar);
99 transition: height
0.18s ease-in;
102 :host(.medium-tall) {
114 pointer-events: none;
118 * TODO: Where should media query breakpoints live so they can be shared between elements?
121 @media (max-width:
639px) {
126 :host(.medium-tall) {
151 :host(.tall) #middleBar,
152 :host(.medium-tall) #middleBar {
153 -webkit-transform: translateY(
100%);
154 transform: translateY(
100%);
166 * make elements (e.g. buttons) respond to mouse/touch events
168 * `.toolbar-tools` disables touch events so multiple toolbars can stack and not
169 * absorb events. All children must have pointer events re-enabled to work as
172 .toolbar-tools
> ::content
> *:not([disabled]) {
173 pointer-events: auto;
176 .toolbar-tools
> ::content .title {
177 @apply(--paper-font-title);
178 @apply(--layout-flex);
180 pointer-events: none;
181 text-overflow: ellipsis;
186 * Polymer/polymer/issues/
1525
187 * --paper-font-title defines a `font-weight`
188 * let's override its value, but we need `important!`
189 * because all mixins are resolved in rule's selector that has higher precedence
190 * than the current selector.
192 font-weight:
400 !important;
196 * TODO: Refactor these selectors
199 .toolbar-tools
> ::content paper-icon-button[icon=menu] {
203 .toolbar-tools
> ::content
> .title,
204 .toolbar-tools
> ::content[
select=
".middle"]
> .title,
205 .toolbar-tools
> ::content[
select=
".bottom"]
> .title {
209 .toolbar-tools
> ::content
> paper-icon-button + .title,
210 .toolbar-tools
> ::content[
select=
".middle"] paper-icon-button + .title,
211 .toolbar-tools
> ::content[
select=
".bottom"] paper-icon-button + .title {
215 .toolbar-tools
> ::content
> .fit {
229 <div id=
"topBar" class$=
"[[_computeBarClassName(justify)]]">
230 <content select=
":not(.middle):not(.bottom)"></content>
233 <div id=
"middleBar" class$=
"[[_computeBarClassName(middleJustify)]]">
234 <content select=
".middle"></content>
237 <div id=
"bottomBar" class$=
"[[_computeBarClassName(bottomJustify)]]">
238 <content select=
".bottom"></content>
245 <script src=
"paper-toolbar-extracted.js"></script></body></html>