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

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-width: 172px;
13 background-color: var(--interactive-color); 13 --chip-height: 40px;
14 border-radius: 20px; 14 --chip-padding-x: 20px;
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), 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
33 height: var(--chip-height);
34 left: 0;
35 padding: 0 var(--chip-padding-x);
36 position: absolute;
37 top: 0;
38 width: calc(var(--chip-width) - var(--chip-padding-x) * 2);
39 }
40
41 #secondary {
42 left: 5px;
43 top: 5px;
30 } 44 }
31 45
32 #title { 46 #title {
33 -webkit-margin-start: 20px; 47 -webkit-margin-start: 20px;
34 color: white; 48 color: white;
35 flex: 1; 49 flex: 1;
36 font-weight: 500; 50 font-weight: 500;
37 overflow: hidden; 51 overflow: hidden;
38 text-decoration: none; 52 text-decoration: none;
39 text-overflow: ellipsis; 53 text-overflow: ellipsis;
40 white-space: nowrap; 54 white-space: nowrap;
41 } 55 }
42 56
43 #icon-wrapper { 57 #icon-wrapper {
44 align-items: center;
45 background: white; 58 background: white;
46 border-radius: 12px; 59 border-radius: 12px;
47 color: var(--secondary-text-color); 60 color: var(--secondary-text-color);
48 display: flex;
49 height: 24px; 61 height: 24px;
50 justify-content: center;
51 position: relative; 62 position: relative;
52 width: 24px; 63 width: 24px;
53 } 64 }
54 65
55 #icon { 66 #icon {
56 background-repeat: no-repeat; 67 background-repeat: no-repeat;
57 height: 16px; 68 height: 16px;
58 margin: 2px; 69 margin: 2px;
59 width: 16px; 70 width: 16px;
60 } 71 }
72
73 .centered {
74 align-items: center;
75 display: flex;
76 justify-content: center;
77 }
78
79 #count {
80 background: var(--google-red-500);
81 border-radius: 12px;
82 color: white;
83 font-weight: 500;
84 height: 24px;
85 min-width: 14px;
86 padding: 0 5px;
87 position: absolute;
88 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
89 top: -10px;
90 }
61 </style> 91 </style>
62 <div id="icon-wrapper"> 92 <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> 93 </div>
67 <div id="title"></div> 94 <div id="primary" class="chip-container centered">
95 <div id="icon-wrapper" class="centered">
96 <iron-icon id="folder-icon" icon="cr:folder" hidden$="[[!isFolder_]]">
97 </iron-icon>
98 <div id="icon" hidden$="[[isFolder_]]"></div>
99 </div>
100 <div id="title"></div>
101 </div>
102 <div id="count" class="centered" hidden$="[[!isMultiItem_]]"></div>
68 </template> 103 </template>
69 <script src="chrome://bookmarks/dnd_chip.js"></script> 104 <script src="chrome://bookmarks/dnd_chip.js"></script>
70 <dom-module> 105 <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