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

Unified Diff: chrome/browser/resources/bluetooth_internals/bluetooth_internals.css

Issue 2538653002: bluetooth: Add sidebar and page manager for chrome://bluetooth-internals. (Closed)
Patch Set: Rearrange HTML layout, change code structure Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/bluetooth_internals/bluetooth_internals.css
diff --git a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css
index 0f4812e4303665280190b0d205c59f33f3801c0c..c2a53e17693d6e169cbe1ae2469d55304871f255 100644
--- a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css
+++ b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css
@@ -13,83 +13,223 @@ body {
padding: 0;
}
+h1 {
+ -webkit-margin-start: 23px;
+ color: rgb(92, 97, 102);
+ margin-bottom: 1em;
+ 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.
+}
ortuno 2016/12/05 05:45:28 There are two types of headers: Sidebar and Page.
mbrunson 2016/12/06 00:25:45 Done.
-/* Header bar */
+/* Page container */
+#page-container {
+ bottom: 0;
+ overflow-y: hidden;
+ position: absolute;
+ top: 0;
+}
-header {
- align-items: center;
- background-color: rgb(33, 150, 243);
- display: flex;
- flex-direction: row;
- font-size: 20pt;
- height: 56px;
- justify-content: flex-start;
- padding: 0 16px;
+#page-container > * {
+ height: 100%;
+}
+
+@media screen and (min-width: 601px) {
+ #page-container {
+ left: 155px;
+ width: calc(100% - 155px);
+ }
}
-.title {
- color: white;
- display: inline-block;
- margin-left: 8px;
+@media screen and (max-width: 600px) {
+ #page-container {
+ width: 100%;
+ }
}
ortuno 2016/12/05 05:45:28 What about: /* Page container */ #page-container
mbrunson 2016/12/06 00:25:45 Done.
+/* Page header */
+#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.
+ background-image: linear-gradient(
+ white, white 40%, rgba(255, 255, 255, 0.92));
+ border-bottom: 1px solid #eee;
+}
-/* Device table */
+#page-container header > h1 {
+ margin: 0;
+ padding: 21px 0 13px;
+}
+
+.menu-btn {
+ background: none;
+ border: 0;
+ height: 24px;
+ left: 18px;
+ padding: 0;
+ position: absolute;
+ top: 18px;
+ width: 24px;
+}
+
+.menu-btn::before {
+ background: rgb(92, 97, 102);
+ box-shadow: 0 0.5em 0 0 rgb(92, 97, 102), 0 1em 0 0 rgb(92, 97, 102);
+ content: '';
+ height: 3px;
+ left: 0;
+ position: absolute;
+ top: 3px;
+ width: 24px;
+}
+
+@media screen and (min-width: 601px) {
+ .menu-btn {
+ display: none;
+ }
+}
+
+@media screen and (max-width: 600px) {
+ #page-container header {
+ left: 0;
+ }
+
+ #page-container header > h1 {
+ padding-left: 64px;
+ }
+}
+
+/* Page content */
+.page-content {
+ max-height: calc(100% - 102px);
+ overflow-y: auto;
+ padding: 24px 16px;
+}
+
ortuno 2016/12/05 05:45:28 If we live #sidebar without "position: absolute" t
mbrunson 2016/12/06 00:25:45 Done.
+/* Sidebar */
+.sidebar-content {
+ background-color: white;
+ bottom: 0;
+ position: absolute;
+ top: 0;
+ width: 155px;
+}
+
+.sidebar-content ul {
+ list-style-type: none;
+ padding: 0;
+}
+
+.sidebar-content button {
+ background-color: transparent;
+ border: 0;
+ color: #999;
+ cursor: pointer;
+ font: inherit;
+ line-height: 1.417em;
+ margin: 6px 0;
+ padding: 0;
+}
+
+.sidebar-content li {
+ -webkit-border-start: 6px solid transparent;
+ -webkit-padding-start: 18px;
+ cursor: pointer;
+ margin: 6px 0;
+}
+
+.sidebar-content .selected {
+ -webkit-border-start-color: rgb(78, 87, 100);
+}
+.sidebar-content .selected > button {
+ color: rgb(70, 78, 90);
+}
+
+.sidebar-content li:hover {
+ background-color: #E0E0E0;
+}
+
+.overlay {
+ background-color: black;
+ bottom: 0;
+ 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
+ left: 0;
+ opacity: 0;
+ 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.
+ right: 0;
+ top: 0;
+ transition: opacity 225ms;
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+@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
+ .sidebar-content li {
+ cursor: pointer;
+ line-height: 30px;
+ }
+
+ .sidebar-content .selected {
+ 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.
+ pointer-events: none;
+ }
+}
+
+@media screen and (max-width: 600px) {
+ .sidebar-content {
+ 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.
+ transition: left 195ms;
+ transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
+ }
+
+ .sidebar-content li {
+ 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.
+ }
+
+ .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.
+ left: 0;
+ transition: left 225ms;
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
+ }
+
+ .overlay.open {
+ display: block;
+ opacity: 0.5;
+ }
+}
+
+/* Device table */
table {
- border: 1px solid #ccc;
border-collapse: collapse;
margin: 0;
padding: 0;
width: 100%;
}
-table tr {
- border: 1px solid #ddd;
- padding: 5px;
-}
-
table th,
table td {
- padding: 10px;
- text-align: center;
+ border: 1px solid rgb(217, 217, 217);
+ padding: 7px;
}
table th {
- font-size: 14px;
- letter-spacing: 1px;
- text-transform: uppercase;
+ background-color: rgb(240, 240, 240);
+ font-weight: normal;
+}
+
+table .removed {
+ background-color: #BDBDBD;
}
@media screen and (max-width: 600px) {
- table {
- border: 0;
- }
table thead {
display: none;
}
- table tr {
- border-bottom: 2px solid #ddd;
- display: block;
- }
+
table td {
- border-bottom: 1px dotted #ccc;
display: block;
- font-size: 13px;
text-align: right;
}
- table td:last-child {
- border-bottom: 0;
- }
+
table td::before {
content: attr(data-label);
float: left;
font-weight: bold;
- text-transform: uppercase;
}
}
-
-/* Device Row */
-table .removed {
- background-color: #BDBDBD;
-}

Powered by Google App Engine
This is Rietveld 408576698