Skip to content

Commit

Permalink
feat: More tweaks to component doc styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 15, 2020
1 parent e6dd2bf commit 742cce1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/components/PageTitle.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.pageTitle {
font-size: 2.5rem;
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
}
9 changes: 6 additions & 3 deletions src/components/PropList.module.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.container {
display: flex;
border-bottom: solid var(--color-neutrals-200) 1px;
padding-bottom: 2rem;
margin-top: 1rem;

&:not(:last-child) {
margin-bottom: 2rem;
padding-bottom: 2rem;
border-bottom: solid var(--color-neutrals-200) 1px;
}
}

.info {
Expand Down
2 changes: 2 additions & 0 deletions src/components/ReferenceExample.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
}

.title {
font-weight: bold;
font-size: 1.25rem;
margin-bottom: 1rem;
}
1 change: 0 additions & 1 deletion src/components/ReferencePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const EXAMPLE_CSS = `
.nr1-ReferenceExample {
line-height: 1.36;
font-weight: 400;
background-color: #fff;
color: #000e0e;
font-size: 12px;
font-family: Open Sans,Segoe UI,Tahoma,sans-serif;
Expand Down
16 changes: 7 additions & 9 deletions src/templates/ComponentReferenceTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ const ComponentReferenceTemplate = ({ data }) => {
<ReactMarkdown source={componentDescription} />
</section>

<section className={templateStyles.section}>
<h2>Usage</h2>
<InlineCodeSnippet language="js">{usage}</InlineCodeSnippet>
</section>

{examples.length > 0 && (
<section className={templateStyles.section}>
<h2>Examples</h2>
<div>
<h2 className={templateStyles.sectionTitle}>Examples</h2>
<div className={templateStyles.section}>
<InlineCodeSnippet language="js">{usage}</InlineCodeSnippet>
</div>
{examples.map((example, i) => (
<ReferenceExample
key={i}
Expand All @@ -79,13 +77,13 @@ const ComponentReferenceTemplate = ({ data }) => {
)}

<section className={templateStyles.section}>
<h2>Props</h2>
<h2 className={templateStyles.sectionTitle}>Props</h2>
<PropList propTypes={propTypes} />
</section>

{methods.length > 0 && (
<section className={templateStyles.section}>
<h2>Methods</h2>
<h2 className={templateStyles.sectionTitle}>Methods</h2>
{methods.map((method, i) => (
<MethodReference key={i} method={method} />
))}
Expand All @@ -94,7 +92,7 @@ const ComponentReferenceTemplate = ({ data }) => {

{typeDefs.length > 0 && (
<section className={templateStyles.section}>
<h2>Type definitions</h2>
<h2 className={templateStyles.sectionTitle}>Type definitions</h2>
{typeDefs.map((typeDef, i) => (
<TypeDefReference key={i} typeDef={typeDef} />
))}
Expand Down
2 changes: 2 additions & 0 deletions src/templates/ComponentReferenceTemplate.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.componentExample:not(:last-child) {
border-bottom: 1px solid var(--color-neutrals-100);
padding-bottom: 2rem;
margin-bottom: 2rem;
}

Expand Down
6 changes: 6 additions & 0 deletions src/templates/ReferenceTemplate.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@
.section:not(:last-child) {
margin-bottom: 2rem;
}

.sectionTitle {
margin-bottom: 1rem;
font-size: 1.75rem;
font-weight: bold;
}

0 comments on commit 742cce1

Please sign in to comment.