Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html

Issue 2140943002: MD WebUI: Center search field correctly inside cr-toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle overlapping text in toolbar Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html
index a50b7853ada9a5c9a7a805dcc76654b82bf82f16..5f0da9873eb708e119a1a998dae14c9b4b7f6597 100644
--- a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html
+++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html
@@ -21,6 +21,8 @@
#leftContent {
align-items: center;
display: flex;
+ position: absolute;
+ transition: opacity 100ms;
}
#leftContent paper-icon-button {
@@ -41,12 +43,20 @@
justify-content: center;
}
+ :host(:not([narrow_])) #centeredContent {
+ /*
+ * Create a 180px area on the left which the search field will never
+ * overlap (it will go off-center to avoid it).
+ */
+ margin: 0 180px;
+ }
+
:host([narrow_]) #centeredContent {
justify-content: flex-end;
}
:host([narrow_][showing-search_]) #leftContent {
- display: none;
+ opacity: 0;
}
</style>
<div id="leftContent">

Powered by Google App Engine
This is Rietveld 408576698