Chromium Code Reviews| 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 */ |
|
dpapad
2017/04/05 23:56:11
Can we use rem units to avoid those complex calcul
dschuyler
2017/04/06 00:53:27
I'm not seeing where this would be better
font-siz
dschuyler
2017/04/06 00:54:57
Though we should probably chat about it outside of
dpapad
2017/04/06 01:06:09
rem units are different than em units.
em: Relati
scottchen
2017/04/06 01:11:13
Like Dave said, rem wouldn't be any shorter in thi
| |
| 45 line-height: 1; | |
| 46 margin-bottom: 16px; | |
| 47 margin-top: 16px; | |
| 46 } | 48 } |
| 47 | 49 |
| 48 #close { | 50 #close { |
| 49 --paper-icon-button: { | 51 --paper-icon-button: { |
| 50 height: 40px; | 52 height: 36px; |
| 51 width: 40px; | 53 width: 36px; |
| 52 }; | 54 }; |
| 53 -webkit-margin-end: 6px; | 55 |
| 56 --layout-inline: { | |
| 57 display: flex; | |
| 58 }; | |
| 59 | |
| 60 -webkit-margin-end: 4px; | |
| 54 /* <paper-icon-button> overrides --iron-icon-{height,width}, so this | 61 /* <paper-icon-button> overrides --iron-icon-{height,width}, so this |
| 55 * padding essentially reduces 40x40 to 20x20. */ | 62 * padding essentially reduces 40x40 to 20x20. */ |
| 56 padding: 10px; | 63 padding: 10px; |
| 57 } | 64 } |
| 58 | 65 |
| 59 .body-container { | 66 .body-container { |
| 60 display: flex; | 67 display: flex; |
| 61 flex-direction: column; | 68 flex-direction: column; |
| 62 overflow: auto; | 69 overflow: auto; |
| 63 @apply(--cr-dialog-body-container); | 70 @apply(--cr-dialog-body-container); |
| 64 } | 71 } |
| 65 | 72 |
| 66 :host([show-scroll-borders]) .body-container { | 73 :host([show-scroll-borders]) .body-container { |
| 67 /* Prevent layout moving when border does appear. */ | 74 /* Prevent layout moving when border does appear. */ |
| 68 border-bottom: 1px solid transparent; | 75 border-bottom: 1px solid transparent; |
| 76 border-top: 1px solid transparent; | |
| 69 } | 77 } |
| 70 | 78 |
| 71 :host([show-scroll-borders]) .body-container.bottom-scrollable { | 79 :host([show-scroll-borders]) .body-container.bottom-scrollable { |
| 72 border-bottom: 1px solid var(--paper-grey-300); | 80 border-bottom: 1px solid var(--paper-grey-300); |
| 73 } | 81 } |
| 74 | 82 |
| 83 :host([show-scroll-borders]) .body-container.top-scrollable { | |
| 84 border-top: 1px solid var(--paper-grey-300); | |
| 85 } | |
| 86 | |
| 75 :host ::content .body { | 87 :host ::content .body { |
| 76 padding-bottom: 12px; | 88 padding-bottom: 8px; |
| 77 padding-top: 12px; | 89 padding-top: 8px; |
| 78 } | 90 } |
| 79 | 91 |
| 80 :host ::content .body, | 92 :host ::content .body, |
| 81 :host ::content .title { | 93 :host ::content .title { |
| 82 -webkit-padding-end: 24px; | 94 -webkit-padding-end: 16px; |
| 83 -webkit-padding-start: 24px; | 95 -webkit-padding-start: 16px; |
| 84 flex: 1; | 96 flex: 1; |
| 85 } | 97 } |
| 86 | 98 |
| 87 :host ::content .button-container { | 99 :host ::content .button-container { |
| 88 -webkit-padding-end: 16px; | 100 -webkit-padding-end: 16px; |
| 89 -webkit-padding-start: 16px; | 101 -webkit-padding-start: 16px; |
| 90 display: flex; | 102 display: flex; |
| 91 justify-content: flex-end; | 103 justify-content: flex-end; |
| 92 margin-bottom: 12px; | 104 margin-bottom: 16px; |
| 93 margin-top: 12px; | 105 margin-top: 16px; |
| 94 } | 106 } |
| 95 | 107 |
| 96 :host ::content .button-container .cancel-button { | 108 :host ::content .button-container .cancel-button { |
| 97 -webkit-margin-end: 8px; | 109 -webkit-margin-end: 8px; |
| 98 color: var(--paper-grey-600); | 110 color: var(--paper-grey-600); |
| 99 } | 111 } |
| 100 | 112 |
| 101 :host ::content .footer { | 113 :host ::content .footer { |
| 102 border-bottom-left-radius: inherit; | 114 border-bottom-left-radius: inherit; |
| 103 border-bottom-right-radius: inherit; | 115 border-bottom-right-radius: inherit; |
| 104 margin: 0; | 116 margin: 0; |
| 105 padding: 16px 20px; | 117 padding: 16px 20px; |
| 106 } | 118 } |
| 107 | 119 |
| 108 :host ::content .border-top-divider { | 120 :host ::content .border-top-divider { |
| 109 border-top: 1px solid var(--divider-color); | 121 border-top: 1px solid var(--divider-color); |
| 110 } | 122 } |
| 111 </style> | 123 </style> |
| 112 <div class="top-container"> | 124 <div class="top-container"> |
| 113 <div class="title-container" tabindex="-1"> | 125 <div class="title-container" tabindex="-1"> |
| 114 <content select=".title"></content> | 126 <content select=".title"></content> |
| 115 </div> | 127 </div> |
| 116 <paper-icon-button icon="cr:clear" on-tap="cancel" id="close" | 128 <paper-icon-button icon="cr:clear" on-tap="cancel" id="close" |
| 117 aria-label$="[[closeText]]"> | 129 aria-label$="[[closeText]]"> |
| 118 </paper-icon-button> | 130 </paper-icon-button> |
| 119 </div> | 131 </div> |
| 120 <div class="body-container"> | 132 <div class="body-container"> |
| 133 <span id="bodyTopMarker"></span> | |
| 121 <content select=".body"></content> | 134 <content select=".body"></content> |
| 122 <span id="bodyBottomMarker"></span> | 135 <span id="bodyBottomMarker"></span> |
| 123 </div> | 136 </div> |
| 124 <content select=".button-container"></content> | 137 <content select=".button-container"></content> |
| 125 <content select=".footer"></content> | 138 <content select=".footer"></content> |
| 126 </template> | 139 </template> |
| 127 <script src="cr_dialog.js"></script> | 140 <script src="cr_dialog.js"></script> |
| 128 </dom-module> | 141 </dom-module> |
| OLD | NEW |