From e521bbddc89b3088849a6930362dba07763bb5ff Mon Sep 17 00:00:00 2001 From: John Otander Date: Wed, 7 Mar 2018 15:29:32 -0700 Subject: [PATCH] Tweak formatting --- docs/modules.js | 16 ++++---- docs/pages/docs/typography/scale.js | 6 +++ docs/typography/scale.md | 59 +++++++++++++++++++++++++++++ docs/ui/Editor.js | 36 +++++++++--------- docs/ui/FontSizes.js | 46 ++++++++++++++++++++++ docs/ui/Layout.js | 11 +++--- docs/ui/ScaleHero.js | 38 +++++++++++++++++++ docs/ui/index.js | 25 ++++++++---- docs/ui/withDocLayout.js | 5 ++- 9 files changed, 202 insertions(+), 40 deletions(-) create mode 100644 docs/pages/docs/typography/scale.js create mode 100644 docs/typography/scale.md create mode 100644 docs/ui/FontSizes.js create mode 100644 docs/ui/ScaleHero.js diff --git a/docs/modules.js b/docs/modules.js index e42d09606..e11466f55 100644 --- a/docs/modules.js +++ b/docs/modules.js @@ -4,8 +4,7 @@ const { readFileSync, writeFileSync } = require('fs') const { dependencies } = require('./package.json') -const px = Object - .keys(dependencies) +const px = Object.keys(dependencies) .filter(m => /^tachyons-/.test(m)) .filter(m => !/^tachyons-(colors|generator|styles)/.test(m)) .map(async m => { @@ -36,10 +35,11 @@ const px = Object } }) -Promise - .all(px) - .then(modules => { - const reduced = modules.reduce((acc, m) => Object.assign(acc, { [m.name]: m }), {}) +Promise.all(px).then(modules => { + const reduced = modules.reduce( + (acc, m) => Object.assign(acc, { [m.name]: m }), + {} + ) - writeFileSync('data.json', JSON.stringify({ modules: reduced }, null, 2)) - }) + writeFileSync('data.json', JSON.stringify({ modules: reduced }, null, 2)) +}) diff --git a/docs/pages/docs/typography/scale.js b/docs/pages/docs/typography/scale.js new file mode 100644 index 000000000..27de98dea --- /dev/null +++ b/docs/pages/docs/typography/scale.js @@ -0,0 +1,6 @@ +import React from 'react' + +import withDocLayout from '../../../ui/withDocLayout' +import Scale from '../../../typography/scale.md' + +export default withDocLayout(Scale) diff --git a/docs/typography/scale.md b/docs/typography/scale.md new file mode 100644 index 000000000..8935feb04 --- /dev/null +++ b/docs/typography/scale.md @@ -0,0 +1,59 @@ +import { BigQuote } from '../ui' +import ScaleHero from '../ui/ScaleHero' +import FontSizes from '../ui/FontSizes' + +# Type Scale + + + + + +### Font sizes + + + +## Examples + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +```.html +

A modular scale, like a musical scale, is a prearranged set of harmonious proportions.

+``` + +## Reference + +- [MDN - Font size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) diff --git a/docs/ui/Editor.js b/docs/ui/Editor.js index 104d5e5e3..8327e89c7 100644 --- a/docs/ui/Editor.js +++ b/docs/ui/Editor.js @@ -5,14 +5,14 @@ import he from 'he' const isDotHTML = (cx = '') => /language-\.html/.test(cx) class Editor extends Component { - constructor (props) { - super() + constructor(props) { + super() - this.state = { + this.state = { shouldLiveEdit: isDotHTML(props.className), - html: props.children[0] || '' - } - } + html: props.children[0] || '' + } + } handleChange = e => { this.setState({ @@ -20,28 +20,28 @@ class Editor extends Component { }) } - render () { - if (!this.state.shouldLiveEdit) { - return - } + render() { + if (!this.state.shouldLiveEdit) { + return + } - return ( -
+ return ( +