Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <link rel="import" href="chrome://resources/html/polymer.html"> | 1 <link rel="import" href="chrome://resources/html/polymer.html"> |
| 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-media-query/iron-m edia-query.html"> | 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-media-query/iron-m edia-query.html"> |
| 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> | 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> |
| 4 <link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar_se arch_field.html"> | 4 <link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar_se arch_field.html"> |
| 5 | 5 |
| 6 <dom-module id="cr-toolbar"> | 6 <dom-module id="cr-toolbar"> |
| 7 <template> | 7 <template> |
| 8 <style> | 8 <style> |
| 9 :host { | 9 :host { |
| 10 --cr-toolbar-field-width: 580px; | |
| 10 color: #fff; | 11 color: #fff; |
| 11 display: flex; | 12 display: flex; |
| 12 height: 56px; | 13 height: 56px; |
| 13 } | 14 } |
| 14 | 15 |
| 15 h1 { | 16 h1 { |
| 16 @apply(--layout-flex); | 17 @apply(--layout-flex); |
| 17 font-size: 123%; | 18 font-size: 123%; |
| 18 font-weight: 400; | 19 font-weight: 400; |
| 20 text-overflow: ellipsis; | |
|
dpapad
2016/07/14 16:47:28
Could those be moved under #leftContent instead of
tsergeant
2016/07/15 01:35:46
Do you mean "instead of h1"?
Playing around with
| |
| 21 overflow: hidden; | |
| 22 white-space: nowrap; | |
| 19 } | 23 } |
| 20 | 24 |
| 21 #leftContent { | 25 #leftContent { |
| 22 align-items: center; | 26 align-items: center; |
| 23 display: flex; | 27 display: flex; |
| 28 overflow: hidden; | |
| 29 position: absolute; | |
| 30 transition: opacity 100ms; | |
| 24 } | 31 } |
| 25 | 32 |
| 26 #leftContent paper-icon-button { | 33 #leftContent paper-icon-button { |
| 27 -webkit-margin-end: 6px; | 34 -webkit-margin-end: 6px; |
| 28 -webkit-margin-start: 18px; | 35 -webkit-margin-start: 18px; |
| 29 height: 32px; | 36 height: 32px; |
| 30 margin-bottom: 6px; | 37 margin-bottom: 6px; |
| 31 margin-top: 6px; | 38 margin-top: 6px; |
| 32 min-width: 32px; | 39 min-width: 32px; |
| 33 padding: 6px; | 40 padding: 6px; |
| 34 width: 32px; | 41 width: 32px; |
| 35 } | 42 } |
| 36 | 43 |
| 37 #centeredContent { | 44 #centeredContent { |
| 38 -webkit-padding-end: 12px; | 45 -webkit-padding-end: 12px; |
| 39 display: flex; | 46 display: flex; |
| 40 flex: 1 1 0; | 47 flex: 1 1 0; |
| 41 justify-content: center; | 48 justify-content: center; |
| 42 } | 49 } |
| 43 | 50 |
| 51 :host(:not([narrow_])) #leftContent { | |
| 52 max-width: calc((100% - var(--cr-toolbar-field-width) - 18px) / 2); | |
|
dpapad
2016/07/14 16:47:28
Nice! I am glad calc() can help us here.
| |
| 53 } | |
| 54 | |
| 44 :host([narrow_]) #centeredContent { | 55 :host([narrow_]) #centeredContent { |
| 45 justify-content: flex-end; | 56 justify-content: flex-end; |
| 46 } | 57 } |
| 47 | 58 |
| 48 :host([narrow_][showing-search_]) #leftContent { | 59 :host([narrow_][showing-search_]) #leftContent { |
| 49 display: none; | 60 opacity: 0; |
| 50 } | 61 } |
| 51 </style> | 62 </style> |
| 52 <div id="leftContent"> | 63 <div id="leftContent"> |
| 53 <paper-icon-button icon="cr:menu" on-tap="onMenuTap_"> | 64 <paper-icon-button icon="cr:menu" on-tap="onMenuTap_"> |
| 54 </paper-icon-button> | 65 </paper-icon-button> |
| 55 <h1>[[pageName]]</h1> | 66 <h1>[[pageName]]</h1> |
| 56 </div> | 67 </div> |
| 57 | 68 |
| 58 <div id="centeredContent"> | 69 <div id="centeredContent"> |
| 59 <cr-toolbar-search-field id="search" narrow="[[narrow_]]" | 70 <cr-toolbar-search-field id="search" narrow="[[narrow_]]" |
| 60 label="[[searchPrompt]]" clear-label="[[clearLabel]]" | 71 label="[[searchPrompt]]" clear-label="[[clearLabel]]" |
| 61 spinner-active="[[spinnerActive]]" | 72 spinner-active="[[spinnerActive]]" |
| 62 showing-search="{{showingSearch_}}"> | 73 showing-search="{{showingSearch_}}"> |
| 63 </cr-toolbar-search-field> | 74 </cr-toolbar-search-field> |
| 64 <iron-media-query query="(max-width: 900px)" query-matches="{{narrow_}}"> | 75 <iron-media-query query="(max-width: 900px)" query-matches="{{narrow_}}"> |
| 65 </iron-media-query> | 76 </iron-media-query> |
| 66 </div> | 77 </div> |
| 67 </template> | 78 </template> |
| 68 <script src="cr_toolbar.js"></script> | 79 <script src="cr_toolbar.js"></script> |
| 69 </dom-module> | 80 </dom-module> |
| OLD | NEW |