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 { |
(...skipping 12 matching lines...) Expand all Loading... | |
23 background-color: rgba(0, 0, 0, 0.6); | 23 background-color: rgba(0, 0, 0, 0.6); |
24 bottom: 0; | 24 bottom: 0; |
25 left: 0; | 25 left: 0; |
26 position: fixed; | 26 position: fixed; |
27 right: 0; | 27 right: 0; |
28 top: 0; | 28 top: 0; |
29 } | 29 } |
30 | 30 |
31 .top-container { | 31 .top-container { |
32 align-items: center; | 32 align-items: center; |
33 border-bottom: 1px solid var(--divider-color); | |
34 display: flex; | 33 display: flex; |
35 min-height: 52px; | 34 min-height: 47px; |
36 } | 35 } |
37 | 36 |
38 .title-container { | 37 .title-container { |
39 display: flex; | 38 display: flex; |
40 flex: 1; | 39 flex: 1; |
41 outline: none; | 40 outline: none; |
42 } | 41 } |
43 | 42 |
44 :host ::content .title { | 43 :host ::content .title { |
45 font-size: 123.07%; /* (16px / 13px) * 100 */ | 44 font-size: 115.38%; /* (15px / 13px) * 100 */ |
45 line-height: 1; | |
46 margin: 16px 0; | |
46 } | 47 } |
47 | 48 |
48 #close { | 49 #close { |
49 --paper-icon-button: { | 50 --paper-icon-button: { |
50 height: 40px; | 51 height: 36px; |
51 width: 40px; | 52 width: 36px; |
52 }; | 53 }; |
53 -webkit-margin-end: 6px; | 54 |
55 --layout-inline: { | |
56 display: flex; | |
57 }; | |
58 | |
59 -webkit-margin-end: 4px; | |
54 /* <paper-icon-button> overrides --iron-icon-{height,width}, so this | 60 /* <paper-icon-button> overrides --iron-icon-{height,width}, so this |
55 * padding essentially reduces 40x40 to 20x20. */ | 61 * padding essentially reduces 40x40 to 20x20. */ |
56 padding: 10px; | 62 padding: 10px; |
57 } | 63 } |
58 | 64 |
59 .body-container { | 65 .body-container { |
60 display: flex; | 66 display: flex; |
61 flex-direction: column; | 67 flex-direction: column; |
62 overflow: auto; | 68 overflow: auto; |
63 @apply(--cr-dialog-body-container); | 69 @apply(--cr-dialog-body-container); |
64 } | 70 } |
65 | 71 |
66 :host([show-scroll-borders]) .body-container { | 72 :host([show-scroll-borders]) .body-container { |
67 /* Prevent layout moving when border does appear. */ | 73 /* Prevent layout moving when border does appear. */ |
68 border-bottom: 1px solid transparent; | 74 border-bottom: 1px solid transparent; |
75 border-top: 1px solid transparent; | |
69 } | 76 } |
70 | 77 |
71 :host([show-scroll-borders]) .body-container.bottom-scrollable { | 78 :host([show-scroll-borders]) .body-container.bottom-scrollable { |
72 border-bottom: 1px solid var(--paper-grey-300); | 79 border-bottom: 1px solid var(--paper-grey-300); |
73 } | 80 } |
74 | 81 |
82 :host([show-scroll-borders]) .body-container.top-scrollable { | |
83 border-top: 1px solid var(--paper-grey-300); | |
dpapad
2017/04/06 23:50:55
Can we declare a variable in :host{} and reuse it
scottchen
2017/04/07 22:55:54
Done.
| |
84 } | |
85 | |
75 :host ::content .body { | 86 :host ::content .body { |
76 padding-bottom: 12px; | 87 padding: 12px 0; |
77 padding-top: 12px; | |
78 } | 88 } |
79 | 89 |
80 :host ::content .body, | 90 :host ::content .body, |
81 :host ::content .title { | 91 :host ::content .title { |
82 -webkit-padding-end: 24px; | 92 padding: 0 16px; |
83 -webkit-padding-start: 24px; | |
84 flex: 1; | 93 flex: 1; |
85 } | 94 } |
86 | 95 |
87 :host ::content .button-container { | 96 :host ::content .button-container { |
88 -webkit-padding-end: 16px; | 97 padding: 0 16px; |
dpapad
2017/04/06 23:50:55
Are you changing this just to compact things? Or d
| |
89 -webkit-padding-start: 16px; | |
90 display: flex; | 98 display: flex; |
91 justify-content: flex-end; | 99 justify-content: flex-end; |
92 margin-bottom: 12px; | 100 margin: 16px 0; |
93 margin-top: 12px; | |
94 } | 101 } |
95 | 102 |
96 :host ::content .button-container .cancel-button { | 103 :host ::content .button-container .cancel-button { |
97 -webkit-margin-end: 8px; | 104 -webkit-margin-end: 8px; |
98 color: var(--paper-grey-600); | 105 color: var(--paper-grey-600); |
99 } | 106 } |
100 | 107 |
101 :host ::content .footer { | 108 :host ::content .footer { |
102 border-bottom-left-radius: inherit; | 109 border-bottom-left-radius: inherit; |
103 border-bottom-right-radius: inherit; | 110 border-bottom-right-radius: inherit; |
104 margin: 0; | 111 margin: 0; |
105 padding: 16px 20px; | 112 padding: 16px 20px; |
106 } | 113 } |
107 | 114 |
108 :host ::content .border-top-divider { | 115 :host ::content .border-top-divider { |
109 border-top: 1px solid var(--divider-color); | 116 border-top: 1px solid var(--divider-color); |
110 } | 117 } |
111 </style> | 118 </style> |
112 <div class="top-container"> | 119 <div class="top-container"> |
113 <div class="title-container" tabindex="-1"> | 120 <div class="title-container" tabindex="-1"> |
114 <content select=".title"></content> | 121 <content select=".title"></content> |
115 </div> | 122 </div> |
116 <paper-icon-button icon="cr:clear" on-tap="cancel" id="close" | 123 <paper-icon-button icon="cr:clear" on-tap="cancel" id="close" |
117 aria-label$="[[closeText]]"> | 124 aria-label$="[[closeText]]"> |
118 </paper-icon-button> | 125 </paper-icon-button> |
119 </div> | 126 </div> |
120 <div class="body-container"> | 127 <div class="body-container"> |
128 <span id="bodyTopMarker"></span> | |
121 <content select=".body"></content> | 129 <content select=".body"></content> |
122 <span id="bodyBottomMarker"></span> | 130 <span id="bodyBottomMarker"></span> |
123 </div> | 131 </div> |
124 <content select=".button-container"></content> | 132 <content select=".button-container"></content> |
125 <content select=".footer"></content> | 133 <content select=".footer"></content> |
126 </template> | 134 </template> |
127 <script src="cr_dialog.js"></script> | 135 <script src="cr_dialog.js"></script> |
128 </dom-module> | 136 </dom-module> |
OLD | NEW |