| 1 |
/** |
| 2 |
* Code block styling |
| 3 |
* Note that we inherit a lot of styling from Bootstrap so not many rules here. |
| 4 |
*/ |
| 5 |
|
| 6 |
// General code block behavior |
| 7 |
// Unset bootstrap behavior |
| 8 |
div[class*="highlight-"], |
| 9 |
div.highlight, |
| 10 |
div.literal-block-wrapper { |
| 11 |
display: flex; |
| 12 |
flex-direction: column; |
| 13 |
width: unset; |
| 14 |
border-radius: $admonition-border-radius; |
| 15 |
break-inside: avoid; |
| 16 |
} |
| 17 |
|
| 18 |
// Code blocks with captions |
| 19 |
// There's a wrapper when the code block has a title |
| 20 |
div.literal-block-wrapper { |
| 21 |
border: 1px solid var(--pst-color-border); |
| 22 |
border-radius: $admonition-border-radius; |
| 23 |
|
| 24 |
// This is where the title goes |
| 25 |
div.code-block-caption { |
| 26 |
margin: 0; |
| 27 |
border-bottom: 1px solid var(--pst-color-border); |
| 28 |
padding: 0.5rem; |
| 29 |
font-size: 1rem; |
| 30 |
font-weight: var(--pst-font-weight-caption); |
| 31 |
|
| 32 |
a.headerlink { |
| 33 |
font-size: inherit; |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
// Remove the upper border radius since we want it to connect with the title |
| 38 |
// Remove the box shadow so the wrapper gets the shadow instead |
| 39 |
div[class*="highlight-"] { |
| 40 |
margin: 0; |
| 41 |
border-radius: 0; |
| 42 |
|
| 43 |
pre { |
| 44 |
border: none; |
| 45 |
box-shadow: none; |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
/** |
| 51 |
* In-line code |
| 52 |
*/ |
| 53 |
code.literal { |
| 54 |
padding: 0.1rem 0.25rem; |
| 55 |
background-color: var(--pst-color-surface); |
| 56 |
border: 1px solid var(--pst-color-border); |
| 57 |
border-radius: 0.25rem; |
| 58 |
} |
| 59 |
|
| 60 |
a > code { |
| 61 |
color: var(--pst-color-link-higher-contrast); |
| 62 |
} |
| 63 |
|
| 64 |
a:hover > code { |
| 65 |
color: var(--pst-color-link-hover); |
| 66 |
} |
| 67 |
|
| 68 |
// Minimum opacity needed for linenos to be WCAG AA conformant |
| 69 |
span.linenos { |
| 70 |
opacity: 0.8 !important; |
| 71 |
} |