Chromium Code Reviews| Index: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html |
| diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html |
| index 9f9af393deb104ff166756a158ea196b0692f911..6849fd649adc61311a863a4da15a60f523e6fae9 100644 |
| --- a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html |
| +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html |
| @@ -25,21 +25,18 @@ |
| paper-icon-button { |
| height: 32px; |
| margin: 6px; |
| + min-width: 32px; |
| padding: 6px; |
| width: 32px; |
| } |
| #icon { |
| --paper-icon-button-ink-color: white; |
| - } |
| - |
| - #icon, |
| - paper-spinner-lite { |
| - transition: opacity 200ms; |
| + transition: margin 150ms, opacity 200ms; |
| } |
| #prompt { |
| - visibility: hidden; |
| + opacity: 0; |
| } |
| paper-spinner-lite { |
| @@ -56,6 +53,11 @@ |
| opacity: 1; |
| } |
| + #prompt, |
| + paper-spinner-lite { |
| + transition: opacity 200ms; |
| + } |
| + |
| paper-input-container { |
| --paper-input-container-input-color: white; |
| --paper-input-container-underline: { |
| @@ -78,8 +80,8 @@ |
| -webkit-appearance: none; |
| } |
| - /** Wide layout, no search open. */ |
| - :host(:not([narrow]):not([showing-search])) { |
| + /** Wide layout. */ |
| + :host(:not([narrow])) { |
| -webkit-padding-end: 0; |
| background: rgba(0, 0, 0, 0.22); |
| border-radius: 2px; |
| @@ -92,21 +94,30 @@ |
| opacity: 0.6; |
| } |
| - :host(:not([narrow]):not([showing-search])) #prompt { |
| - visibility: visible; |
| + :host([narrow]:not([showing-search])) paper-input-container { |
| + display: none; |
| + } |
| + |
| + /* Search open. */ |
| + :host([showing-search][spinner-active]) #icon { |
| + opacity: 0; |
| } |
| - /* Any layout, search open. */ |
| - :host([showing-search]) { |
| + :host([narrow][showing-search]) { |
| width: 100%; |
| } |
| - :host([showing-search][spinner-active]) #icon { |
| - opacity: 0; |
| + /* |
| + * Margin needs to be animated to prevent jumping around during |
| + * opening/closing. -webkit-margin-start is not animatable, so we have to |
| + * use regular margin-left/right instead. |
| + */ |
| + :host-context([dir=ltr]):host([narrow][showing-search]) #icon { |
| + margin-left: 18px; |
|
dpapad
2016/07/13 20:50:11
Can we not merge this CSS rule and the next one by
tsergeant
2016/07/14 03:50:51
-webkit-margin-start doesn't animate, and having t
|
| } |
| - :host([narrow][showing-search]) #icon { |
| - -webkit-margin-start: 18px; |
| + :host-context([dir=rtl]):host([narrow][showing-search]) #icon { |
| + margin-right: 18px; |
| } |
| </style> |
| <paper-spinner-lite |