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

Side by Side Diff: chrome/browser/resources/md_bookmarks/dnd_chip.html

Issue 2972633002: [MD Bookmarks] Add UI for multi-item drag and drop chip. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/dnd_chip.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <link rel="import" href="chrome://resources/html/polymer.html"> 1 <link rel="import" href="chrome://resources/html/polymer.html">
2 2
3 <link rel="import" href="chrome://resources/cr_elements/icons.html"> 3 <link rel="import" href="chrome://resources/cr_elements/icons.html">
4 <link rel="import" href="chrome://resources/html/icon.html"> 4 <link rel="import" href="chrome://resources/html/icon.html">
5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> 5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l">
6 <link rel="import" href="chrome://bookmarks/shared_style.html"> 6 <link rel="import" href="chrome://bookmarks/shared_style.html">
7 7
8 <dom-module id="bookmarks-dnd-chip"> 8 <dom-module id="bookmarks-dnd-chip">
9 <template> 9 <template>
10 <style include="shared-style"> 10 <style include="shared-style">
11 :host { 11 :host {
12 align-items: center; 12 --chip-height: 40px;
13 background-color: var(--interactive-color); 13 --chip-padding-x: 20px;
14 border-radius: 20px; 14 --chip-width: 172px;
15 box-shadow: 0 0 8px 0 rgba(0,0,0,0.12), 0 8px 8px 0 rgba(0,0,0,0.24); 15
16 display: none;
17 height: 40px;
18 left: 0; 16 left: 0;
19 padding: 0 20px;
20 pointer-events: none; 17 pointer-events: none;
21 position: absolute; 18 position: absolute;
22 top: 0; 19 top: 0;
23 transform: translate( 20 transform: translate(calc(var(--mouse-x) - var(--chip-width) * 0.5),
24 calc(var(--mouse-x) - 50%), calc(var(--mouse-y) - 80%)); 21 calc(var(--mouse-y) - var(--chip-height) * 0.8));
25 width: 132px; 22 z-index: 2;
26 } 23 }
27 24
28 :host([showing_]) { 25 :host(:not([showing_])) {
29 display: flex; 26 display: none;
27 }
28
29 .chip-container {
30 background-color: var(--interactive-color);
31 border-radius: calc(var(--chip-height) / 2);
32 box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.12),
33 0 8px 8px 0 rgba(0, 0, 0, 0.24);
34 height: var(--chip-height);
35 left: 0;
36 padding: 0 var(--chip-padding-x);
37 position: absolute;
38 top: 0;
39 width: calc(var(--chip-width) - var(--chip-padding-x) * 2);
40 }
41
42 #secondary {
43 left: 5px;
44 top: 5px;
30 } 45 }
31 46
32 #title { 47 #title {
33 -webkit-margin-start: 20px; 48 -webkit-margin-start: 20px;
34 color: white; 49 color: white;
35 flex: 1; 50 flex: 1;
36 font-weight: 500; 51 font-weight: 500;
37 overflow: hidden; 52 overflow: hidden;
38 text-decoration: none; 53 text-decoration: none;
39 text-overflow: ellipsis; 54 text-overflow: ellipsis;
40 white-space: nowrap; 55 white-space: nowrap;
41 } 56 }
42 57
43 #icon-wrapper { 58 #icon-wrapper {
44 align-items: center;
45 background: white; 59 background: white;
46 border-radius: 12px; 60 border-radius: 12px;
47 color: var(--secondary-text-color); 61 color: var(--secondary-text-color);
48 display: flex;
49 height: 24px; 62 height: 24px;
50 justify-content: center;
51 position: relative; 63 position: relative;
52 width: 24px; 64 width: 24px;
53 } 65 }
54 66
55 #icon { 67 #icon {
56 background-repeat: no-repeat; 68 background-repeat: no-repeat;
57 height: 16px; 69 height: 16px;
58 margin: 2px; 70 margin: 2px;
59 width: 16px; 71 width: 16px;
60 } 72 }
73
74 .centered {
75 align-items: center;
76 display: flex;
77 justify-content: center;
78 }
79
80 #count {
81 background: var(--google-red-500);
82 border-radius: 12px;
83 color: white;
84 font-weight: 500;
85 height: 24px;
86 min-width: 14px;
87 padding: 0 5px;
88 position: absolute;
89 right: -170px;
90 top: -10px;
91 }
92
93 :host-context([dir='rtl']) #count {
94 left: 2px;
95 right: auto;
96 }
61 </style> 97 </style>
62 <div id="icon-wrapper"> 98 <div id="secondary" class="chip-container" hidden$="[[!isMultiItem_]]">
63 <iron-icon id="folder-icon" icon="cr:folder" hidden$="[[!isFolder_]]">
64 </iron-icon>
65 <div id="icon" hidden$="[[isFolder_]]"></div>
66 </div> 99 </div>
67 <div id="title"></div> 100 <div id="primary" class="chip-container centered">
101 <div id="icon-wrapper" class="centered">
102 <iron-icon id="folder-icon" icon="cr:folder" hidden$="[[!isFolder_]]">
103 </iron-icon>
104 <div id="icon" hidden$="[[isFolder_]]"></div>
105 </div>
106 <div id="title"></div>
107 </div>
108 <div id="count" class="centered" hidden$="[[!isMultiItem_]]"></div>
68 </template> 109 </template>
69 <script src="chrome://bookmarks/dnd_chip.js"></script> 110 <script src="chrome://bookmarks/dnd_chip.js"></script>
70 <dom-module> 111 <dom-module>
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/dnd_chip.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698