1// 2// Code (inline and blocK) 3// -------------------------------------------------- 4 5// Inline and block code styles 6code, 7pre { 8 @include font-family-monospace(); 9 font-size: $font-size-base - 2; 10 background-color: $code-tag-bg; 11 color: $text-color; 12 border: 1px solid $code-tag-border; 13 border-radius: 4px; 14} 15 16// Inline code 17code { 18 color: $text-color; 19 white-space: nowrap; 20 padding: 2px 5px; 21 margin: 0 2px; 22} 23 24code.code--small { 25 font-size: $font-size-xs; 26 padding: $space-xxs; 27 margin: 0 2px; 28} 29 30// Blocks of code 31pre { 32 display: block; 33 margin: 0 0 $line-height-base; 34 line-height: $line-height-base; 35 word-break: break-all; 36 word-wrap: break-word; 37 white-space: pre; 38 white-space: pre-wrap; 39 background-color: $code-tag-bg; 40 padding: 10px; 41 42 &.pre--no-style { 43 background: transparent; 44 border: none; 45 padding: 0px; 46 } 47 48 // Make prettyprint styles more spaced out for readability 49 &.prettyprint { 50 margin-bottom: $line-height-base; 51 } 52 53 // Account for some code outputs that place code tags in pre tags 54 code { 55 padding: 0; 56 color: inherit; 57 white-space: pre; 58 white-space: pre-wrap; 59 background-color: transparent; 60 border: 0; 61 } 62} 63