Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
adding markdown story to storybook
  • Loading branch information
jonrohan committed Oct 5, 2017
commit 6626240e7ffc0d371943853c0c32c7c86ddbd2e3
1 change: 0 additions & 1 deletion .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<link rel="stylesheet" href="https://unpkg.com/primer-css@9.2.0/build/build.css">
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

<script src="https://github.com/site/assets/styleguide.js" async></script>
7 changes: 1 addition & 6 deletions modules/primer-markdown/lib/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Inline code snippets
code,
tt {
padding: 0.2em;
padding: 0.2em 0.4em;
Copy link
Contributor

Choose a reason for hiding this comment

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

One day in the future we should bring this into our proposed em-based scale and stick to common fractions.

margin: 0;
font-size: 85%;
background-color: rgba($black, 0.05);
Expand Down Expand Up @@ -59,10 +59,5 @@
word-wrap: normal;
background-color: transparent;
border: 0;

&::before,
&::after {
content: normal;
}
}
}
18 changes: 18 additions & 0 deletions modules/primer-markdown/stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉 Yay for adding more stories! It would be great to add the rest of the markdown styles when you get a chance.

import { storiesOf } from '@storybook/react'

storiesOf('Markdown', module)
.add('code', () => (
<div className="markdown-body">
<p>
This is inline <code>code block</code>. This <code>code block has a &lt;br&gt;<br/> in it</code>. <code>When a code block has a long sentence in it, it should wrap the page to a new line</code>. Some people like to see the world burn and put <code>reallylongunbrokenstringsreallylongunbrokenstringsreallylongunbrokenstringsreallylongunbrokenstringsreallylongunbrokenstrings</code> in the code blocks.
</p>
</div>
))
.add('pre', () => (
<div className="markdown-body">
<pre>
<code>Really long pre blocks should scroll horizontally when the words are longer than the parent container</code>
</pre>
</div>
))