Skip to content

Commit

Permalink
Add mono font stack to <samp> tag (#1876)
Browse files Browse the repository at this point in the history
* Add mono font stack to <samp> tag

* Create nice-beers-peel.md

* Add `<samp>` example to docs

* Test

* Another try without the HTML entities

Co-authored-by: simurai <[email protected]>
  • Loading branch information
vdepizzol and simurai authored Jan 26, 2022
1 parent fdacefd commit bcf447a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-beers-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": minor
---

Add mono font stack to <samp> tag
8 changes: 8 additions & 0 deletions docs/content/components/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ bundle: markdown

<hr />

<p>The <code>samp</code> HTML element is used to enclose inline text which represents sample (or quoted) output from a computer program. Here an example of an error message: <samp>File not found</samp></p>

<hr />

<p>Small images should be shown at their actual size.</p>

<p><img src="http://placekitten.com/g/300/200/"></p>
Expand Down Expand Up @@ -458,6 +462,10 @@ Inline code inside table cells should still be distinguishable.
----------------
The `<samp>` HTML element is used to enclose inline text which represents sample (or quoted) output from a computer program. Here an example of an error message: <samp>File not found</samp>
----------------
Small images should be shown at their actual size.
![](http://placekitten.com/g/300/200/)
Expand Down
2 changes: 1 addition & 1 deletion src/base/normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ code,
kbd,
pre,
samp {
font-family: monospace, monospace; /* 1 */
font-family: monospace; /* 1 */
font-size: 1em; /* 2 */
}

Expand Down
5 changes: 3 additions & 2 deletions src/base/typography-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ dd {
margin-left: 0;
}

// Code
// Monospaced
// --------------------------------------------------

tt,
code {
code,
samp {
font-family: $mono-font;
font-size: $font-size-small;
}
Expand Down
5 changes: 5 additions & 0 deletions src/markdown/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

del code { text-decoration: inherit; }

samp {
// stylelint-disable-next-line primer/typography
font-size: 85%;
}

pre {
word-wrap: normal;

Expand Down

0 comments on commit bcf447a

Please sign in to comment.