Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <link rel="import" href="chrome://resources/cr_elements/cr_search_field/cr_searc h_field.html"> | |
| 2 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | |
| 3 <link rel="import" href="chrome://resources/html/polymer.html"> | |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.h tml"> | |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> | |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input -container.html"> | |
| 7 | |
| 8 <dom-module id="cr-toolbar"> | |
| 9 <template> | |
| 10 <style> | |
|
tsergeant
2016/05/24 00:37:27
TODO:
* blur closes the search field
* correct co
| |
| 11 :host { | |
| 12 color: #fff; | |
| 13 display: flex; | |
| 14 height: 56px; | |
| 15 } | |
| 16 | |
| 17 h1 { | |
| 18 @apply(--layout-flex); | |
| 19 -webkit-padding-start: 24px; | |
| 20 font-size: 123%; | |
| 21 font-weight: 400; | |
| 22 } | |
| 23 | |
| 24 #leftContent { | |
| 25 align-items: center; | |
| 26 display: flex; | |
| 27 width: var(--side-bar-width, 0); | |
| 28 } | |
| 29 | |
| 30 #centeredContent { | |
| 31 -webkit-padding-end: 4px; | |
| 32 display: flex; | |
| 33 flex: 1 1 0; | |
| 34 justify-content: center; | |
| 35 } | |
| 36 | |
| 37 #centeredContent cr-search-field { | |
| 38 --paper-icon-button: { | |
| 39 width: 32px; | |
| 40 height: 32px; | |
| 41 padding: 6px; | |
| 42 }; | |
| 43 --cr-search-field-search-button: { | |
| 44 margin: 6px; | |
| 45 }; | |
| 46 --cr-search-field-container: { | |
| 47 max-width: initial; | |
| 48 }; | |
| 49 --cr-search-color: white; | |
| 50 --cr-search-field-search-button-color: white; | |
| 51 --paper-icon-button-ink-color: white; | |
| 52 --paper-input-container-underline: { | |
| 53 display: none; | |
| 54 }; | |
| 55 --paper-input-container-underline-focus: { | |
| 56 display: none; | |
| 57 }; | |
| 58 align-items: center; | |
| 59 height: 40px; | |
| 60 justify-content: flex-start; | |
| 61 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), | |
| 62 width 150ms cubic-bezier(0.4, 0, 0.2, 1); | |
| 63 } | |
| 64 | |
| 65 #prompt { | |
| 66 display: none; | |
| 67 overflow: hidden; | |
| 68 white-space: nowrap; | |
| 69 } | |
| 70 | |
| 71 #searchContainer { | |
| 72 -webkit-padding-start: 2px; | |
| 73 flex: 1; | |
| 74 } | |
| 75 | |
| 76 /** Thin layout, no search open. */ | |
| 77 @media(max-width: 900px) { | |
| 78 #centeredContent { | |
| 79 justify-content: flex-end; | |
| 80 } | |
| 81 | |
| 82 cr-search-field { | |
| 83 width: 54px; | |
| 84 } | |
| 85 } | |
| 86 | |
| 87 /** Wide layout, no search open. */ | |
| 88 @media(min-width: 901px) { | |
| 89 :host(:not([showing-search_])) cr-search-field { | |
| 90 -webkit-padding-end: 0; | |
| 91 background: rgba(0, 0, 0, 0.22); | |
| 92 border-radius: 2px; | |
| 93 cursor: text; | |
| 94 width: 580px; | |
| 95 } | |
| 96 | |
| 97 :host(:not([showing-search_])) #searchIcon, | |
| 98 :host(:not([showing-search_])) #prompt { | |
| 99 display: inline; | |
| 100 opacity: 0.6; | |
| 101 } | |
| 102 } | |
| 103 | |
| 104 /* Any layout, search open. */ | |
| 105 :host([showing-search_]) cr-search-field { | |
| 106 width: 100%; | |
| 107 } | |
| 108 | |
| 109 /* Thin layout, search open. */ | |
| 110 @media(max-width: 900px) { | |
| 111 :host([showing-search_]) #leftContent { | |
| 112 display: none; | |
| 113 } | |
| 114 | |
| 115 :host([showing-search_]) #searchIcon { | |
| 116 margin-left: 18px; | |
| 117 } | |
| 118 } | |
| 119 </style> | |
| 120 <div id="leftContent"> | |
| 121 <h1>[[pageName]]</h1> | |
| 122 </div> | |
| 123 | |
| 124 <div id="centeredContent"> | |
| 125 <cr-search-field id="search" showing-search="{{showingSearch_}}" | |
| 126 search-prompt="[[searchPrompt]]" clear-label="[[clearLabel]]"> | |
| 127 <div id="prompt">Search history</div> | |
| 128 </cr-search-field> | |
| 129 </div> | |
| 130 </template> | |
| 131 <script src="cr_toolbar.js"></script> | |
| 132 </dom-module> | |
| OLD | NEW |