Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

fix(docs): snippet & TOC fixes #50

Merged
merged 1 commit into from
Oct 31, 2019
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
15 changes: 15 additions & 0 deletions gatsby-theme-patternfly-org/templates/mdx.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
padding-top: 32px;
}

@media (max-width: 767px) {
.ws-section {
padding: 16px;
padding-top: 16px;
}
}

.ws-section:first-of-type {
padding-bottom: 0;
}
Expand All @@ -17,3 +24,11 @@
margin-right: 30px;
display: inline-block;
}

.ws-page-title {
margin: 8px 0 16px;
}

.ws-page-title ~ p {
font-size: 18px;
}
22 changes: 8 additions & 14 deletions gatsby-theme-patternfly-org/templates/mdx.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default ({ data, location, pageContext }) => {
<Title size="md" className="ws-framework-title">
{source === 'core' ? 'HTML' : capitalize(source)}
</Title>
<Title size="4xl">{title}</Title>
<Title size="4xl" className="ws-page-title">{title}</Title>
{optIn && (
<Alert
variant="info"
Expand All @@ -92,11 +92,13 @@ export default ({ data, location, pageContext }) => {
{getWarning(experimentalStage)}
</Alert>
)}
{data.designDoc && (
<a href="#design" className="ws-toc">
Design
</a>
)}
{data.designDoc &&
<React.Fragment>
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need the React.Fragment

<MDXRenderer>
{data.designDoc.body}
</MDXRenderer>
</React.Fragment>
}
{tableOfContents.map(heading => (
<a key={heading} href={`#${slugger(heading)}`} className="ws-toc">
{heading}
Expand Down Expand Up @@ -128,14 +130,6 @@ export default ({ data, location, pageContext }) => {
{...props} />,
...commonComponents
}}>
{data.designDoc &&
<React.Fragment>
<AutoLinkHeader size="h2" id="design" className="ws-title">Design</AutoLinkHeader>
<MDXRenderer>
{data.designDoc.body}
</MDXRenderer>
</React.Fragment>
}
<MDXRenderer>
{data.doc.body}
</MDXRenderer>
Expand Down