-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from kadirahq/inline-css-for-markdown
Using markdown-to-react-components for rendering markdown.
- Loading branch information
Showing
9 changed files
with
231 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { configure } from '@kadira/storybook'; | ||
|
||
configure(function () { | ||
require('../styles.css'); | ||
require('../src/stories/Story'); | ||
}, module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
|
||
export class Code extends React.Component { | ||
render() { | ||
const style = { | ||
fontSize: '1.88em', | ||
fontFamily: 'Menlo, Monaco, "Courier New", monospace', | ||
backgroundColor: '#fafafa', | ||
}; | ||
|
||
return <code style={style}>{this.props.children}</code>; | ||
} | ||
} | ||
|
||
export class Pre extends React.Component { | ||
render() { | ||
const style = { | ||
fontSize: '.88em', | ||
fontFamily: 'Menlo, Monaco, "Courier New", monospace', | ||
backgroundColor: '#fafafa', | ||
padding: '.5rem', | ||
lineHeight: 1.5, | ||
overflowX: 'scroll', | ||
}; | ||
|
||
return <pre style={style}>{this.props.children}</pre>; | ||
} | ||
} | ||
|
||
export class Blockquote extends React.Component { | ||
render() { | ||
const style = { | ||
fontSize: '1.88em', | ||
fontFamily: 'Menlo, Monaco, "Courier New", monospace', | ||
borderLeft: '8px solid #fafafa', | ||
padding: '1rem', | ||
}; | ||
|
||
return <blockquote style={style}>{this.props.children}</blockquote>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import React from 'react'; | ||
|
||
export class H1 extends React.Component { | ||
render() { | ||
const styles = { | ||
fontFamily: 'Arimo, Helvetica, sans-serif', | ||
color: '#777', | ||
borderBottom: '2px solid #fafafa', | ||
marginBottom: '1.15rem', | ||
paddingBottom: '.5rem', | ||
margin: '1.414rem 0 .5rem', | ||
fontWeight: 'inherit', | ||
lineHeight: 1.42, | ||
textAlign: 'center', | ||
marginTop: 0, | ||
fontSize: '3.998rem', | ||
}; | ||
|
||
return <h1 id={this.props.id} style={styles}>{this.props.children}</h1>; | ||
} | ||
} | ||
|
||
export class H2 extends React.Component { | ||
render() { | ||
const styles = { | ||
fontFamily: 'Arimo, Helvetica, sans-serif', | ||
borderBottom: '2px solid #fafafa', | ||
marginBottom: '1.15rem', | ||
paddingBottom: '.5rem', | ||
margin: '1.414rem 0 .5rem', | ||
fontWeight: 'inherit', | ||
lineHeight: 1.42, | ||
fontSize: '2.827rem', | ||
}; | ||
|
||
return <h2 id={this.props.id} style={styles}>{this.props.children}</h2>; | ||
} | ||
} | ||
|
||
export class H3 extends React.Component { | ||
render() { | ||
const styles = { | ||
fontFamily: 'Arimo, Helvetica, sans-serif', | ||
borderBottom: '2px solid #fafafa', | ||
marginBottom: '1.15rem', | ||
paddingBottom: '.5rem', | ||
margin: '1.414rem 0 .5rem', | ||
fontWeight: 'inherit', | ||
lineHeight: 1.42, | ||
fontSize: '1.999rem', | ||
}; | ||
|
||
return <h3 id={this.props.id} style={styles}>{this.props.children}</h3>; | ||
} | ||
} | ||
|
||
export class H4 extends React.Component { | ||
render() { | ||
const styles = { | ||
fontFamily: 'Arimo, Helvetica, sans-serif', | ||
color: '#444', | ||
margin: '1.414rem 0 .5rem', | ||
fontWeight: 'inherit', | ||
lineHeight: 1.42, | ||
fontSize: '1.414rem', | ||
}; | ||
|
||
return <h4 id={this.props.id} style={styles}>{this.props.children}</h4>; | ||
} | ||
} | ||
|
||
export class H5 extends React.Component { | ||
render() { | ||
const styles = { | ||
fontFamily: 'Arimo, Helvetica, sans-serif', | ||
fontSize: '1.121rem', | ||
}; | ||
|
||
return <h5 id={this.props.id} style={styles}>{this.props.children}</h5>; | ||
} | ||
} | ||
|
||
export class H6 extends React.Component { | ||
render() { | ||
const styles = { | ||
fontFamily: 'Arimo, Helvetica, sans-serif', | ||
fontSize: '.88rem', | ||
}; | ||
|
||
return <h6 id={this.props.id} style={styles}>{this.props.children}</h6>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { H1, H2, H3, H4, H5, H6 } from './htags'; | ||
export { Code, Pre } from './code'; | ||
export { P, Small, A } from './text'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
|
||
export class P extends React.Component { | ||
render() { | ||
const style = { | ||
fontFamily: 'Arimo, Helvetica, sans-serif', | ||
fontSize: '1rem', | ||
marginBottom: '1.3rem', | ||
color: '#444', | ||
}; | ||
return <p style={style}>{this.props.children}</p>; | ||
} | ||
} | ||
|
||
export class Small extends React.Component { | ||
render() { | ||
const style = {}; | ||
|
||
return <ul style={style}>{this.props.children}</ul>; | ||
} | ||
} | ||
|
||
export class A extends React.Component { | ||
render() { | ||
const style = { | ||
color: '#3498db', | ||
}; | ||
|
||
return <a href={this.props.href} style={style}>{this.props.children}</a>; | ||
} | ||
} | ||
|
Oops, something went wrong.