Skip to content

Commit d0da962

Browse files
committed
refinements
1 parent 954d9c3 commit d0da962

27 files changed

+168
-215
lines changed

site/_core/CodeLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var CodeLayout = React.createClass({
1616
render: function() {
1717
var page = this.props.page;
1818
var site = this.props.site;
19-
var firstURL = '/graphql-js/getting-started/';
19+
var firstURL = '/graphql-js/';
2020
var category = page.category;
2121
if (!category.match(/GraphQL/)) {
2222
category = 'GraphQL.js ' + category;

site/_core/DocsLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var DocsLayout = React.createClass({
2020
return (
2121
<Site section="docs" title={page.title}>
2222
<section className="content documentationContent">
23-
<DocsSidebar site={site} page={page} />
2423
<div className="inner-content">
2524
<h1>{page.title}</h1>
2625
<Marked>{page.content}</Marked>
@@ -29,6 +28,7 @@ var DocsLayout = React.createClass({
2928
{page.next && <a className="docs-next" href={path.resolve(page.url, page.next)}>Next &rarr;</a>}
3029
</div>
3130
</div>
31+
<DocsSidebar site={site} page={page} />
3232
</section>
3333
</Site>
3434
);

site/_core/DocsSidebar.js

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ function sidebarForCategory(thisPageID, category) {
1616
var target = page.url.match(/^https?:/) && '_blank';
1717
var marginLeft = page.indent ? 20 : 0;
1818

19+
// Sublinks to any page sub-parts
20+
var sublinkUL = page.sublinks &&
21+
<ul>{page.sublinks.split(',').map(sublink =>
22+
<li key={sublink}>
23+
<a target={target} href={page.url + '#' + sublink.toLowerCase()}>
24+
{sublink}
25+
</a>
26+
</li>
27+
)}</ul>;
28+
1929
// Link for the main page overall
2030
listItems.push(
2131
<li key={page.permalink}>
@@ -26,29 +36,13 @@ function sidebarForCategory(thisPageID, category) {
2636
href={page.url}>
2737
{page.sidebarTitle || page.title}
2838
</a>
39+
{sublinkUL}
2940
</li>
3041
);
31-
32-
// Sublinks to any page sub-parts
33-
if (page.sublinks) {
34-
var sublinks = page.sublinks.split(',').sort();
35-
for (var sublink of sublinks) {
36-
listItems.push(
37-
<li key={page.permalink + '-' + sublink}>
38-
<a
39-
target={target}
40-
style={{marginLeft: marginLeft + 20}}
41-
href={page.url + '#' + sublink.toLowerCase()}>
42-
{sublink}
43-
</a>
44-
</li>
45-
);
46-
}
47-
}
4842
}
4943

5044
return (
51-
<div className="nav-docs-section" key={category.name}>
45+
<div key={category.name}>
5246
<h3>{category.name}</h3>
5347
<ul>{listItems}</ul>
5448
</div>

site/_css/docs.less

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
@import "variables.less";
2+
3+
.documentationContent {
4+
margin-bottom: 8em;
5+
@media screen and (max-width: 1019px) {
6+
margin-bottom: 4em;
7+
}
8+
9+
&:after {
10+
clear: both;
11+
content: " ";
12+
display: table;
13+
}
14+
}
15+
16+
.inner-content {
17+
float: left;
18+
max-width: 760px;
19+
margin-right: 210px;
20+
@media screen and (max-width: 740px) {
21+
margin-right: 0;
22+
}
23+
24+
& > h1:first-child {
25+
margin-top: 1em;
26+
}
27+
28+
blockquote {
29+
padding: 0.5em 1em 0.5em 0.5em;
30+
margin: 1em 0;
31+
background-color: rgba(204, 122, 111, 0.05);
32+
border-left: 5px solid rgba(191, 87, 73, 0.1);
33+
34+
h4 {
35+
margin-top: 0;
36+
}
37+
38+
p {
39+
margin-bottom: 0;
40+
41+
&:first-child {
42+
margin-top: 0;
43+
}
44+
}
45+
}
46+
47+
img {
48+
max-width: 100%;
49+
}
50+
}
51+
52+
.docs-prevnext {
53+
padding-top: 40px;
54+
padding-bottom: 40px;
55+
56+
.docs-prev {
57+
float: left;
58+
}
59+
60+
.docs-next {
61+
float: right;
62+
}
63+
}
64+
65+
.nav-docs {
66+
color: @text-color;
67+
float: right;
68+
font-size: 13px;
69+
margin: 1em 0 4em;
70+
width: 175px;
71+
margin-left: -210px;
72+
73+
@media screen and (max-width: 740px) {
74+
float: none;
75+
width: auto;
76+
margin-left: 0;
77+
}
78+
79+
h3 {
80+
.body-font(@size: 13px);
81+
text-transform: uppercase;
82+
margin: 3em 0 1.5em;
83+
}
84+
85+
ul {
86+
list-style: none;
87+
margin: 0;
88+
89+
li {
90+
margin: 0;
91+
92+
ul {
93+
margin-bottom: 10px;
94+
95+
li {
96+
line-height: 24px;
97+
}
98+
}
99+
}
100+
}
101+
102+
a {
103+
color: #666;
104+
display: block;
105+
106+
&:hover, &:focus, &.active {
107+
text-decoration: none;
108+
color: @rhodamine-color;
109+
}
110+
}
111+
}

0 commit comments

Comments
 (0)