Chromium Code Reviews| Index: chrome/browser/resources/md_bookmarks/dnd_chip.html |
| diff --git a/chrome/browser/resources/md_bookmarks/dnd_chip.html b/chrome/browser/resources/md_bookmarks/dnd_chip.html |
| index 9703e169ec632a7ddbb3fdbb21364b091116eadb..8c851ac72101f1e0f4f51f61af5c1193eca3fd03 100644 |
| --- a/chrome/browser/resources/md_bookmarks/dnd_chip.html |
| +++ b/chrome/browser/resources/md_bookmarks/dnd_chip.html |
| @@ -9,24 +9,38 @@ |
| <template> |
| <style include="shared-style"> |
| :host { |
| - align-items: center; |
| + --chip-width: 172px; |
| + --chip-height: 40px; |
| + --chip-padding-x: 20px; |
| + |
| + left: 0; |
| + pointer-events: none; |
| + position: absolute; |
| + top: 0; |
| + transform: translate(calc(var(--mouse-x) - var(--chip-width) * 0.5), |
| + calc(var(--mouse-y) - var(--chip-height) * 0.8)); |
| + z-index: 2; |
| + } |
| + |
| + :host(:not([showing_])) { |
| + display: none; |
| + } |
| + |
| + .chip-container { |
| background-color: var(--interactive-color); |
| - border-radius: 20px; |
| + border-radius: calc(var(--chip-height) / 2); |
| box-shadow: 0 0 8px 0 rgba(0,0,0,0.12), 0 8px 8px 0 rgba(0,0,0,0.24); |
|
tsergeant
2017/07/05 01:30:25
Nit: Missed this last time, but these rgba values
calamity
2017/07/05 07:10:09
Done. Surprised the linter didn't catch this.
tsergeant
2017/07/05 07:36:19
The CSS linter only checks a few specific things r
|
| - display: none; |
| - height: 40px; |
| + height: var(--chip-height); |
| left: 0; |
| - padding: 0 20px; |
| - pointer-events: none; |
| + padding: 0 var(--chip-padding-x); |
| position: absolute; |
| top: 0; |
| - transform: translate( |
| - calc(var(--mouse-x) - 50%), calc(var(--mouse-y) - 80%)); |
| - width: 132px; |
| + width: calc(var(--chip-width) - var(--chip-padding-x) * 2); |
| } |
| - :host([showing_]) { |
| - display: flex; |
| + #secondary { |
| + left: 5px; |
| + top: 5px; |
| } |
| #title { |
| @@ -41,13 +55,10 @@ |
| } |
| #icon-wrapper { |
| - align-items: center; |
| background: white; |
| border-radius: 12px; |
| color: var(--secondary-text-color); |
| - display: flex; |
| height: 24px; |
| - justify-content: center; |
| position: relative; |
| width: 24px; |
| } |
| @@ -58,13 +69,37 @@ |
| margin: 2px; |
| width: 16px; |
| } |
| + |
| + .centered { |
| + align-items: center; |
| + display: flex; |
| + justify-content: center; |
| + } |
| + |
| + #count { |
| + background: var(--google-red-500); |
| + border-radius: 12px; |
| + color: white; |
| + font-weight: 500; |
| + height: 24px; |
| + min-width: 14px; |
| + padding: 0 5px; |
| + position: absolute; |
| + right: -170px; |
|
tsergeant
2017/07/05 01:30:25
This looks a bit wonky in RTL.
calamity
2017/07/05 07:10:09
Fixed. But frankly, I don't know how to parse RTL
|
| + top: -10px; |
| + } |
| </style> |
| - <div id="icon-wrapper"> |
| - <iron-icon id="folder-icon" icon="cr:folder" hidden$="[[!isFolder_]]"> |
| - </iron-icon> |
| - <div id="icon" hidden$="[[isFolder_]]"></div> |
| + <div id="secondary" class="chip-container" hidden$="[[!isMultiItem_]]"> |
| + </div> |
| + <div id="primary" class="chip-container centered"> |
| + <div id="icon-wrapper" class="centered"> |
| + <iron-icon id="folder-icon" icon="cr:folder" hidden$="[[!isFolder_]]"> |
| + </iron-icon> |
| + <div id="icon" hidden$="[[isFolder_]]"></div> |
| + </div> |
| + <div id="title"></div> |
| </div> |
| - <div id="title"></div> |
| + <div id="count" class="centered" hidden$="[[!isMultiItem_]]"></div> |
| </template> |
| <script src="chrome://bookmarks/dnd_chip.js"></script> |
| <dom-module> |