Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright 2016 The Chromium Authors. All rights reserved. | 1 /* Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 | 5 |
| 6 html { | 6 html { |
| 7 margin: 0; | 7 margin: 0; |
| 8 padding: 0; | 8 padding: 0; |
| 9 } | 9 } |
| 10 | 10 |
| 11 body { | 11 body { |
| 12 margin: 0; | 12 margin: 0; |
| 13 padding: 0; | 13 padding: 0; |
| 14 } | 14 } |
| 15 | 15 |
| 16 | 16 h1 { |
| 17 /* Header bar */ | 17 -webkit-margin-start: 23px; |
| 18 | 18 color: rgb(92, 97, 102); |
| 19 header { | 19 margin-bottom: 1em; |
| 20 align-items: center; | 20 margin-top: 21px; |
|
ortuno
2016/12/05 05:45:28
Some of these values seem pretty random. Any reaso
mbrunson
2016/12/06 00:25:45
I was using chrome://settings's CSS as a guide. Ea
ortuno
2016/12/06 10:16:04
:( hopefully we share more with polymer.
| |
| 21 background-color: rgb(33, 150, 243); | 21 } |
|
ortuno
2016/12/05 05:45:28
There are two types of headers: Sidebar and Page.
mbrunson
2016/12/06 00:25:45
Done.
| |
| 22 display: flex; | 22 |
| 23 flex-direction: row; | 23 /* Page container */ |
| 24 font-size: 20pt; | 24 #page-container { |
| 25 height: 56px; | 25 bottom: 0; |
| 26 justify-content: flex-start; | 26 overflow-y: hidden; |
| 27 padding: 0 16px; | 27 position: absolute; |
| 28 } | 28 top: 0; |
| 29 | 29 } |
| 30 .title { | 30 |
| 31 color: white; | 31 #page-container > * { |
| 32 display: inline-block; | 32 height: 100%; |
| 33 margin-left: 8px; | 33 } |
| 34 } | 34 |
| 35 | 35 @media screen and (min-width: 601px) { |
| 36 #page-container { | |
| 37 left: 155px; | |
| 38 width: calc(100% - 155px); | |
| 39 } | |
| 40 } | |
| 41 | |
| 42 @media screen and (max-width: 600px) { | |
| 43 #page-container { | |
| 44 width: 100%; | |
| 45 } | |
| 46 } | |
|
ortuno
2016/12/05 05:45:28
What about:
/* Page container */
#page-container
mbrunson
2016/12/06 00:25:45
Done.
| |
| 47 | |
| 48 /* Page header */ | |
| 49 #page-container header { | |
|
ortuno
2016/12/05 05:45:28
I think we can simplify things a bit if we used fl
mbrunson
2016/12/06 00:25:45
Done.
| |
| 50 background-image: linear-gradient( | |
| 51 white, white 40%, rgba(255, 255, 255, 0.92)); | |
| 52 border-bottom: 1px solid #eee; | |
| 53 } | |
| 54 | |
| 55 #page-container header > h1 { | |
| 56 margin: 0; | |
| 57 padding: 21px 0 13px; | |
| 58 } | |
| 59 | |
| 60 .menu-btn { | |
| 61 background: none; | |
| 62 border: 0; | |
| 63 height: 24px; | |
| 64 left: 18px; | |
| 65 padding: 0; | |
| 66 position: absolute; | |
| 67 top: 18px; | |
| 68 width: 24px; | |
| 69 } | |
| 70 | |
| 71 .menu-btn::before { | |
| 72 background: rgb(92, 97, 102); | |
| 73 box-shadow: 0 0.5em 0 0 rgb(92, 97, 102), 0 1em 0 0 rgb(92, 97, 102); | |
| 74 content: ''; | |
| 75 height: 3px; | |
| 76 left: 0; | |
| 77 position: absolute; | |
| 78 top: 3px; | |
| 79 width: 24px; | |
| 80 } | |
| 81 | |
| 82 @media screen and (min-width: 601px) { | |
| 83 .menu-btn { | |
| 84 display: none; | |
| 85 } | |
| 86 } | |
| 87 | |
| 88 @media screen and (max-width: 600px) { | |
| 89 #page-container header { | |
| 90 left: 0; | |
| 91 } | |
| 92 | |
| 93 #page-container header > h1 { | |
| 94 padding-left: 64px; | |
| 95 } | |
| 96 } | |
| 97 | |
| 98 /* Page content */ | |
| 99 .page-content { | |
| 100 max-height: calc(100% - 102px); | |
| 101 overflow-y: auto; | |
| 102 padding: 24px 16px; | |
| 103 } | |
| 104 | |
|
ortuno
2016/12/05 05:45:28
If we live #sidebar without "position: absolute" t
mbrunson
2016/12/06 00:25:45
Done.
| |
| 105 /* Sidebar */ | |
| 106 .sidebar-content { | |
| 107 background-color: white; | |
| 108 bottom: 0; | |
| 109 position: absolute; | |
| 110 top: 0; | |
| 111 width: 155px; | |
| 112 } | |
| 113 | |
| 114 .sidebar-content ul { | |
| 115 list-style-type: none; | |
| 116 padding: 0; | |
| 117 } | |
| 118 | |
| 119 .sidebar-content button { | |
| 120 background-color: transparent; | |
| 121 border: 0; | |
| 122 color: #999; | |
| 123 cursor: pointer; | |
| 124 font: inherit; | |
| 125 line-height: 1.417em; | |
| 126 margin: 6px 0; | |
| 127 padding: 0; | |
| 128 } | |
| 129 | |
| 130 .sidebar-content li { | |
| 131 -webkit-border-start: 6px solid transparent; | |
| 132 -webkit-padding-start: 18px; | |
| 133 cursor: pointer; | |
| 134 margin: 6px 0; | |
| 135 } | |
| 136 | |
| 137 .sidebar-content .selected { | |
| 138 -webkit-border-start-color: rgb(78, 87, 100); | |
| 139 } | |
| 140 | |
| 141 .sidebar-content .selected > button { | |
| 142 color: rgb(70, 78, 90); | |
| 143 } | |
| 144 | |
| 145 .sidebar-content li:hover { | |
| 146 background-color: #E0E0E0; | |
| 147 } | |
| 148 | |
| 149 .overlay { | |
| 150 background-color: black; | |
| 151 bottom: 0; | |
| 152 display: none; | |
|
ortuno
2016/12/05 05:45:27
We are already changing the opacity so might as we
mbrunson
2016/12/06 00:25:45
Opacity only changes the transparency. Since the o
ortuno
2016/12/06 10:16:04
Right, but now we set visibility on #sidebar, so I
mbrunson
2016/12/07 01:12:13
Yes. But the sidebar is visible by default on larg
ortuno
2016/12/07 02:58:17
Ah right. On my version I had sidebar-content as p
mbrunson
2016/12/07 04:26:07
Ah I see. I added opacity as well and just set the
| |
| 153 left: 0; | |
| 154 opacity: 0; | |
| 155 position: fixed; | |
|
ortuno
2016/12/05 05:45:28
If you add #sidebar { position: fixed; } then this
mbrunson
2016/12/06 00:25:45
Done.
| |
| 156 right: 0; | |
| 157 top: 0; | |
| 158 transition: opacity 225ms; | |
| 159 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); | |
| 160 } | |
| 161 | |
| 162 @media screen and (min-width: 601px) { | |
|
ortuno
2016/12/05 05:45:28
I'm curious as to why you use the following patter
mbrunson
2016/12/06 00:25:45
Yeah. I originally wanted to make things explicit
| |
| 163 .sidebar-content li { | |
| 164 cursor: pointer; | |
| 165 line-height: 30px; | |
| 166 } | |
| 167 | |
| 168 .sidebar-content .selected { | |
| 169 cursor: default; | |
|
ortuno
2016/12/05 05:45:27
Why change this depending on size?
mbrunson
2016/12/06 00:25:44
I don't think I need this anymore actually.
| |
| 170 pointer-events: none; | |
| 171 } | |
| 172 } | |
| 173 | |
| 174 @media screen and (max-width: 600px) { | |
| 175 .sidebar-content { | |
| 176 left: -155px; | |
|
ortuno
2016/12/05 05:45:28
Prefer to use transform when animating for two rea
mbrunson
2016/12/06 00:25:45
Done.
| |
| 177 transition: left 195ms; | |
| 178 transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1); | |
| 179 } | |
| 180 | |
| 181 .sidebar-content li { | |
| 182 line-height: 48px; | |
|
ortuno
2016/12/05 05:45:27
Why do you change this in smaller screens? It look
mbrunson
2016/12/06 00:25:45
The area for the buttons should be bigger to compe
ortuno
2016/12/06 10:16:04
I see. What about 40px? Seems like an acceptable s
mbrunson
2016/12/07 01:12:13
Done.
| |
| 183 } | |
| 184 | |
| 185 .sidebar-content.open { | |
|
ortuno
2016/12/05 05:45:28
We can save ourselves some js lines by adding the
mbrunson
2016/12/06 00:25:45
Done.
| |
| 186 left: 0; | |
| 187 transition: left 225ms; | |
| 188 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); | |
| 189 } | |
| 190 | |
| 191 .overlay.open { | |
| 192 display: block; | |
| 193 opacity: 0.5; | |
| 194 } | |
| 195 } | |
| 36 | 196 |
| 37 /* Device table */ | 197 /* Device table */ |
| 38 | |
| 39 table { | 198 table { |
| 40 border: 1px solid #ccc; | |
| 41 border-collapse: collapse; | 199 border-collapse: collapse; |
| 42 margin: 0; | 200 margin: 0; |
| 43 padding: 0; | 201 padding: 0; |
| 44 width: 100%; | 202 width: 100%; |
| 45 } | 203 } |
| 46 | 204 |
| 47 table tr { | |
| 48 border: 1px solid #ddd; | |
| 49 padding: 5px; | |
| 50 } | |
| 51 | |
| 52 table th, | 205 table th, |
| 53 table td { | 206 table td { |
| 54 padding: 10px; | 207 border: 1px solid rgb(217, 217, 217); |
| 55 text-align: center; | 208 padding: 7px; |
| 56 } | 209 } |
| 57 | 210 |
| 58 table th { | 211 table th { |
| 59 font-size: 14px; | 212 background-color: rgb(240, 240, 240); |
| 60 letter-spacing: 1px; | 213 font-weight: normal; |
| 61 text-transform: uppercase; | 214 } |
| 62 } | 215 |
| 63 | 216 table .removed { |
| 64 @media screen and (max-width: 600px) { | 217 background-color: #BDBDBD; |
| 65 table { | 218 } |
| 66 border: 0; | 219 |
| 67 } | 220 @media screen and (max-width: 600px) { |
| 68 table thead { | 221 table thead { |
| 69 display: none; | 222 display: none; |
| 70 } | 223 } |
| 71 table tr { | 224 |
| 72 border-bottom: 2px solid #ddd; | 225 table td { |
| 73 display: block; | 226 display: block; |
| 74 } | |
| 75 table td { | |
| 76 border-bottom: 1px dotted #ccc; | |
| 77 display: block; | |
| 78 font-size: 13px; | |
| 79 text-align: right; | 227 text-align: right; |
| 80 } | 228 } |
| 81 table td:last-child { | 229 |
| 82 border-bottom: 0; | |
| 83 } | |
| 84 table td::before { | 230 table td::before { |
| 85 content: attr(data-label); | 231 content: attr(data-label); |
| 86 float: left; | 232 float: left; |
| 87 font-weight: bold; | 233 font-weight: bold; |
| 88 text-transform: uppercase; | 234 } |
| 89 } | 235 } |
| 90 } | |
| 91 | |
| 92 /* Device Row */ | |
| 93 table .removed { | |
| 94 background-color: #BDBDBD; | |
| 95 } | |
| OLD | NEW |