Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nav to take full width in the docs page #935

Merged
merged 3 commits into from
Sep 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/core/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class DocsLayout extends React.Component {
metadata={metadata}>
<div className="docMainWrapper wrapper">
<DocsSidebar metadata={metadata} />
<Container className="mainContainer">
<Container className="mainContainer docMainContainer">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not directly add the rules within docMainContainer into mainContainer? Is there a need for a new class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the class is used in other page, like blog so it may break the other page if i modify it directly

<DocComponent
metadata={metadata}
content={content}
Expand Down Expand Up @@ -116,7 +116,7 @@ class DocsLayout extends React.Component {
)}
</Container>
{hasOnPageNav && (
<nav className="onPageNav">
<nav className="onPageNav docOnPageNav">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question regarding this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the class is used in other page, like blog so it may break the other page if i modify it directly

<OnPageNav rawContent={content} />
</nav>
)}
Expand Down
26 changes: 23 additions & 3 deletions lib/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,8 @@ input::placeholder {

@media only screen and (min-width: 1024px) {
.docMainWrapper {
width: 100%;
max-width:100% !important ;
margin: 0;
}

.docMainWrapper > * {
Expand Down Expand Up @@ -1564,7 +1565,9 @@ input::placeholder {

@media only screen and (min-width: 1024px) {
.docsNavContainer {
flex: 0 0 240px;
flex: 1 0 240px;
display: flex;
justify-content: flex-end;
height: calc(100vh - 50px);
position: -webkit-sticky;
position: sticky;
Expand Down Expand Up @@ -1607,7 +1610,7 @@ input::placeholder {
}

.separateOnPageNav .docsNavContainer {
flex: 0 0 240px;
flex: 1 0 240px;
}
}

Expand Down Expand Up @@ -1952,6 +1955,11 @@ input::placeholder {
width: auto;
}

.docsNavContainer > :first-child {
width: 240px;
max-width: 240px;
}

.separateOnPageNav.sideNavVisible .navPusher .mainContainer {
flex: 1 auto;
max-width: 100%;
Expand All @@ -1969,6 +1977,10 @@ input::placeholder {
top: 90px;
}

.docOnPageNav {
flex: 1 0 240px;
}

.onPageNav > .toc-headings {
border-left: 1px solid #e0e0e0;
padding: 10px 0 2px 15px;
Expand All @@ -1980,6 +1992,14 @@ input::placeholder {
}
}


@media only screen and (min-width: 1024px) {
.separateOnPageNav.sideNavVisible .navPusher .docMainContainer {
flex-basis: 784px;
flex-grow: 0;
}
}

/* Blog */
.blog .wrapper {
max-width: 1100px;
Expand Down