OLD | NEW |
1 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | 1 <link rel="import" href="chrome://resources/cr_elements/icons.html"> |
2 <link rel="import" href="chrome://resources/html/assert.html"> | 2 <link rel="import" href="chrome://resources/html/assert.html"> |
3 <link rel="import" href="chrome://resources/html/polymer.html"> | 3 <link rel="import" href="chrome://resources/html/polymer.html"> |
4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> | 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> |
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/default-th
eme.html"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/default-th
eme.html"> |
6 | 6 |
7 <dom-module id="cr-dialog"> | 7 <dom-module id="cr-dialog"> |
8 <template> | 8 <template> |
9 <style> | 9 <style> |
10 :host { | 10 :host { |
| 11 --scroll-border: 1px solid var(--paper-grey-300); |
11 border: 0; | 12 border: 0; |
12 border-radius: 2px; | 13 border-radius: 2px; |
13 bottom: 0; | 14 bottom: 0; |
14 box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.12), | 15 box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.12), |
15 0px 16px 16px rgba(0, 0, 0, 0.24); | 16 0px 16px 16px rgba(0, 0, 0, 0.24); |
16 color: inherit; | 17 color: inherit; |
17 padding: 0; | 18 padding: 0; |
18 top: 0; | 19 top: 0; |
19 width: 512px; | 20 width: 512px; |
20 } | 21 } |
21 | 22 |
22 :host::backdrop { | 23 :host::backdrop { |
23 background-color: rgba(0, 0, 0, 0.6); | 24 background-color: rgba(0, 0, 0, 0.6); |
24 bottom: 0; | 25 bottom: 0; |
25 left: 0; | 26 left: 0; |
26 position: fixed; | 27 position: fixed; |
27 right: 0; | 28 right: 0; |
28 top: 0; | 29 top: 0; |
29 } | 30 } |
30 | 31 |
31 .top-container { | |
32 align-items: center; | |
33 border-bottom: 1px solid var(--divider-color); | |
34 display: flex; | |
35 min-height: 52px; | |
36 } | |
37 | |
38 .title-container { | |
39 display: flex; | |
40 flex: 1; | |
41 outline: none; | |
42 } | |
43 | |
44 :host ::content .title { | |
45 font-size: 123.07%; /* (16px / 13px) * 100 */ | |
46 } | |
47 | |
48 #close { | |
49 --paper-icon-button: { | |
50 height: 40px; | |
51 width: 40px; | |
52 }; | |
53 -webkit-margin-end: 6px; | |
54 /* <paper-icon-button> overrides --iron-icon-{height,width}, so this | |
55 * padding essentially reduces 40x40 to 20x20. */ | |
56 padding: 10px; | |
57 } | |
58 | |
59 .body-container { | |
60 display: flex; | |
61 flex-direction: column; | |
62 overflow: auto; | |
63 @apply(--cr-dialog-body-container); | |
64 } | |
65 | |
66 :host([show-scroll-borders]) .body-container { | 32 :host([show-scroll-borders]) .body-container { |
67 /* Prevent layout moving when border does appear. */ | 33 /* Prevent layout moving when border does appear. */ |
68 border-bottom: 1px solid transparent; | 34 border-bottom: 1px solid transparent; |
| 35 border-top: 1px solid transparent; |
69 } | 36 } |
70 | 37 |
71 :host([show-scroll-borders]) .body-container.bottom-scrollable { | 38 :host([show-scroll-borders]) .body-container.bottom-scrollable { |
72 border-bottom: 1px solid var(--paper-grey-300); | 39 border-bottom: var(--scroll-border); |
| 40 } |
| 41 |
| 42 :host([show-scroll-borders]) .body-container.top-scrollable { |
| 43 border-top: var(--scroll-border); |
73 } | 44 } |
74 | 45 |
75 :host ::content .body { | 46 :host ::content .body { |
76 padding-bottom: 12px; | 47 padding: 12px 16px; |
77 padding-top: 12px; | |
78 } | 48 } |
79 | 49 |
80 :host ::content .body, | |
81 :host ::content .title { | 50 :host ::content .title { |
82 -webkit-padding-end: 24px; | 51 font-size: 115.38%; /* (15px / 13px) * 100 */ |
83 -webkit-padding-start: 24px; | 52 line-height: 1; |
| 53 padding: 16px 16px; |
84 flex: 1; | 54 flex: 1; |
85 } | 55 } |
86 | 56 |
87 :host ::content .button-container { | 57 :host ::content .button-container { |
88 -webkit-padding-end: 16px; | 58 padding: 16px 16px; |
89 -webkit-padding-start: 16px; | |
90 display: flex; | 59 display: flex; |
91 justify-content: flex-end; | 60 justify-content: flex-end; |
92 margin-bottom: 12px; | |
93 margin-top: 12px; | |
94 } | 61 } |
95 | 62 |
96 :host ::content .button-container .cancel-button { | 63 :host ::content .button-container .cancel-button { |
97 -webkit-margin-end: 8px; | 64 -webkit-margin-end: 8px; |
98 color: var(--paper-grey-600); | 65 color: var(--paper-grey-600); |
99 } | 66 } |
100 | 67 |
101 :host ::content .footer { | 68 :host ::content .footer { |
102 border-bottom-left-radius: inherit; | 69 border-bottom-left-radius: inherit; |
103 border-bottom-right-radius: inherit; | 70 border-bottom-right-radius: inherit; |
104 margin: 0; | 71 margin: 0; |
105 padding: 16px 20px; | 72 padding: 16px 20px; |
106 } | 73 } |
107 | 74 |
108 :host ::content .border-top-divider { | 75 :host ::content .border-top-divider { |
109 border-top: 1px solid var(--divider-color); | 76 border-top: 1px solid var(--divider-color); |
110 } | 77 } |
| 78 |
| 79 .body-container { |
| 80 display: flex; |
| 81 flex-direction: column; |
| 82 overflow: auto; |
| 83 @apply(--cr-dialog-body-container); |
| 84 } |
| 85 |
| 86 .top-container { |
| 87 align-items: center; |
| 88 display: flex; |
| 89 min-height: 47px; |
| 90 } |
| 91 |
| 92 .title-container { |
| 93 display: flex; |
| 94 flex: 1; |
| 95 outline: none; |
| 96 } |
| 97 |
| 98 #close { |
| 99 --paper-icon-button: { |
| 100 height: 36px; |
| 101 width: 36px; |
| 102 }; |
| 103 |
| 104 --layout-inline: { |
| 105 display: flex; |
| 106 }; |
| 107 |
| 108 -webkit-margin-end: 4px; |
| 109 padding: 10px; /* Makes the actual icon 16x16. */ |
| 110 } |
111 </style> | 111 </style> |
112 <div class="top-container"> | 112 <div class="top-container"> |
113 <div class="title-container" tabindex="-1"> | 113 <div class="title-container" tabindex="-1"> |
114 <content select=".title"></content> | 114 <content select=".title"></content> |
115 </div> | 115 </div> |
116 <paper-icon-button icon="cr:clear" on-tap="cancel" id="close" | 116 <paper-icon-button icon="cr:clear" on-tap="cancel" id="close" |
117 aria-label$="[[closeText]]"> | 117 aria-label$="[[closeText]]"> |
118 </paper-icon-button> | 118 </paper-icon-button> |
119 </div> | 119 </div> |
120 <div class="body-container"> | 120 <div class="body-container"> |
| 121 <span id="bodyTopMarker"></span> |
121 <content select=".body"></content> | 122 <content select=".body"></content> |
122 <span id="bodyBottomMarker"></span> | 123 <span id="bodyBottomMarker"></span> |
123 </div> | 124 </div> |
124 <content select=".button-container"></content> | 125 <content select=".button-container"></content> |
125 <content select=".footer"></content> | 126 <content select=".footer"></content> |
126 </template> | 127 </template> |
127 <script src="cr_dialog.js"></script> | 128 <script src="cr_dialog.js"></script> |
128 </dom-module> | 129 </dom-module> |
OLD | NEW |