Skip to content

Commit

Permalink
Tweak formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
johno committed Mar 7, 2018
1 parent 4369af3 commit e4b3307
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 39 deletions.
16 changes: 8 additions & 8 deletions docs/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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))
})
36 changes: 18 additions & 18 deletions docs/ui/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,43 @@ 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({
html: e.target.value
})
}

render () {
if (!this.state.shouldLiveEdit) {
return <code {...this.props} />
}
render() {
if (!this.state.shouldLiveEdit) {
return <code {...this.props} />
}

return (
<div>
return (
<div>
<textarea
rows={1}
className='w-100 bn code black-70 ph0 mb2 input-reset'
className="w-100 bn code black-70 ph0 mb2 input-reset"
value={this.state.html}
onChange={this.handleChange}
/>
<div
className='sans-serif'
<div
className="sans-serif"
dangerouslySetInnerHTML={{
__html: he.decode(this.state.html)
}}
/>
</div>
)
}
</div>
)
}
}

export default Editor
11 changes: 6 additions & 5 deletions docs/ui/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { version } from '../package.json'
import Header from './Header'
import Footer from './Footer'

export default ({ title = 'TACHYONS - Css Toolkit', className = '', children }) => (
export default ({
title = 'TACHYONS - Css Toolkit',
className = '',
children
}) => (
<div className="w-100 sans-serif">
<title>{title}</title>
<link
Expand All @@ -13,9 +17,6 @@ export default ({ title = 'TACHYONS - Css Toolkit', className = '', children })
/>

<Header version={version} />
<main
className={className}
children={children}
/>
<main className={className} children={children} />
</div>
)
14 changes: 7 additions & 7 deletions docs/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export const TitleLink = ({ href = '#!', subtext, text, ...props }) => (
)

export const md = {
h1: props => <h1 className='f6 ttu tracked mt0' {...props} />,
h2: props => <h2 className='f5 mt4 pb2 bb' {...props} />,
h3: props => <h3 className='f5 mt4' {...props} />,
p: props => <p className='measure f5 lh-copy' {...props} />,
ul: props => <ul className='pl3' {...props} />,
li: props => <li className='lh-copy ml2' {...props} />,
h1: props => <h1 className="f6 ttu tracked mt0" {...props} />,
h2: props => <h2 className="f5 mt4 pb2 bb" {...props} />,
h3: props => <h3 className="f5 mt4" {...props} />,
p: props => <p className="measure f5 lh-copy" {...props} />,
ul: props => <ul className="pl3" {...props} />,
li: props => <li className="lh-copy ml2" {...props} />,
a: ({ href, ...props }) => (
<Link href={href}>
<a className='dim link blue' {...props} />
<a className="dim link blue" {...props} />
</Link>
),
code: Editor
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/withDocLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default Component => ({ title, ...props }) => (
<ComponentsProvider components={md}>
<Layout title={title}>
<NavElements />
<Container padding={true} className='black-70'>
<Container padding={true} className="black-70">
<Component {...props} />
</Container>
</Layout>
Expand Down

0 comments on commit e4b3307

Please sign in to comment.