Refine styles to better match current dartlang.org (#1916)
* Link to source now works, minus icons
* Add material icons
* Refactor dartdoc_test to avoid asynchronous delete collisions
* dartfmt
* Fix windows
* dartfmt
* Tweak padding and change icon to description
* Fix styles to match dartlang site
* Review comments
* Add example and use it in the dartdoc package.
* dartfmt
* Review comment
diff --git a/lib/resources/styles.css b/lib/resources/styles.css
index 59e0590..7963f15 100644
--- a/lib/resources/styles.css
+++ b/lib/resources/styles.css
@@ -16,6 +16,13 @@
margin: 0;
padding: 0;
height: 100%;
+ width: 100%;
+ overflow: hidden;
+ box-sizing: border-box;
+}
+
+*, *:before, *:after {
+ box-sizing: inherit;
}
body {
@@ -25,7 +32,7 @@
}
header {
- flex: 0 0 56px;
+ flex: 0 0 50px;
display: flex;
flex-direction: row;
align-items: center;
@@ -64,12 +71,14 @@
flex: 1;
display: flex;
flex-direction: row;
+ padding: 20px;
}
.sidebar-offcanvas-left {
- flex: 0 1 195px;
+ flex: 0 1 230px;
overflow-y: scroll;
padding: 20px 0 15px 30px;
+ margin: 5px 20px 0 0;
}
::-webkit-scrollbar-button{ display: none; height: 13px; border-radius: 0px; background-color: #AAA; }
@@ -77,23 +86,21 @@
::-webkit-scrollbar-thumb{ background-color: #CCC; }
::-webkit-scrollbar-thumb:hover{ background-color: #CCC; }
::-webkit-scrollbar{ width: 4px; }
+::-webkit-overflow-scrolling: touch;
+
.main-content::-webkit-scrollbar{ width: 8px; }
.main-content {
flex: 1;
- overflow-y: auto;
- padding: 20px 15px 0 30px;
-}
-
-.sidebar,
-.main-content {
- margin: 20px 0;
+ overflow-y: scroll;
+ padding: 10px 20px 0 20px;
}
.sidebar-offcanvas-right {
flex: 0 1 12em;
- overflow-y: auto;
+ overflow-y: scroll;
padding: 20px 15px 15px 15px;
+ margin-top: 5px;
margin-right: 20px;
}
/* end for layout */
@@ -101,7 +108,7 @@
body {
-webkit-text-size-adjust: 100%;
overflow-x: hidden;
- font-family: "Source Sans Pro", sans-serif;
+ font-family: Roboto, sans-serif;
font-size: 16px;
line-height: 1.42857143;
color: #111111;
@@ -185,7 +192,7 @@
h4,
h5,
h6 {
- font-family: "Source Sans Pro", sans-serif;
+ font-family: Roboto, sans-serif;
font-weight: 400;
margin-top: 1.5em;
color: #111111;
@@ -226,8 +233,12 @@
margin-top: 0;
}
-a, a:hover {
- color: #1155cc;
+a {
+ color: #0175C2;
+}
+
+a:hover {
+ color: #13B9FD;
}
pre.prettyprint {
@@ -294,10 +305,13 @@
}
header a,
-header a:hover,
header p,
header li {
- color: #111;
+ color: #111111;
+}
+
+header a:hover {
+ color: #0175C2;
}
header h1 .kind {
@@ -439,10 +453,13 @@
.source-link {
padding: 18px 4px;
- font-size: 12px;
vertical-align: middle;
}
+.source-link .material-icons {
+ font-size: 18px;
+}
+
@media (max-width: 768px) {
.source-link {
padding: 7px 2px;
@@ -695,10 +712,6 @@
padding-top: 0;
}
-.sidebar ol li.section-title a {
- color: inherit;
-}
-
.sidebar ol li.section-title {
font-size: 18px;
font-weight: normal;
@@ -768,10 +781,12 @@
z-index: 2000;
top: 0;
width: 280px; /* works all the way down to an iphone 4 */
- height: 100%;
+ height: 90%;
background-color: white;
- overflow-y: auto; /* TODO: how to hide scroll bars? */
+ overflow-y: scroll; /* TODO: how to hide scroll bars? */
padding: 10px;
+ margin: 10px 10px;
+ box-shadow: 5px 5px 5px 5px #444444;
}
ol#sidebar-nav {
@@ -852,7 +867,7 @@
left: inherit !important;
width: 422px;
max-height: 250px;
- overflow-y: auto;
+ overflow-y: scroll;
}
.tt-menu {
diff --git a/lib/templates/_head.html b/lib/templates/_head.html
index 3628bd9..5fffa11 100644
--- a/lib/templates/_head.html
+++ b/lib/templates/_head.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
{{#includeVersion}}
<meta name="generator" content="made with love by dartdoc {{version}}">
{{/includeVersion}}