Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 3 additions & 16 deletions modules/primer-markdown/lib/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@
// Inline code snippets
code,
tt {
padding: 0;
padding-top: 0.2em;
padding-bottom: 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);
border-radius: 3px; // don't add padding, gives scrollbars

&::before,
&::after {
letter-spacing: -0.2em; // this creates padding
content: "\00a0";
}
border-radius: $border-radius;

br { display: none; }
}
Expand Down Expand Up @@ -53,7 +45,7 @@
font-size: 85%;
line-height: 1.45;
background-color: $gray-100;
border-radius: 3px;
border-radius: $border-radius;
}

pre code,
Expand All @@ -67,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>
))