| 1 |
@import '~prismjs/themes/prism.css'; |
| 2 |
@import '~prismjs/plugins/line-numbers/prism-line-numbers.css'; |
| 3 |
@import '~prismjs/plugins/toolbar/prism-toolbar.css'; |
| 4 |
@import '~prismjs/plugins/inline-color/prism-inline-color.css'; |
| 5 |
@import '~prismjs/plugins/previewers/prism-previewers.css'; |
| 6 |
@import '~prismjs/plugins/autolinker/prism-autolinker.css'; |
| 7 |
|
| 8 |
/* These lines are taken from '~prismjs/plugins/inline-color/prism-inline-color.css', adjusted to avoid autoprefixer |
| 9 |
complaining about deprecated syntax. Ideally, they can be removed if the file in question is updated. */ |
| 10 |
|
| 11 |
pre[data-line]] { |
| 12 |
position: relative; |
| 13 |
padding: 1em 0 1em 3em; |
| 14 |
} |
| 15 |
|
| 16 |
.line-highlight { |
| 17 |
position: absolute; |
| 18 |
left: 0; |
| 19 |
right: 0; |
| 20 |
padding: inherit; |
| 21 |
margin-top: 1em; |
| 22 |
background: hsla(24, 20%, 50%, .08); |
| 23 |
background: linear-gradient(to right, hsla(24, 20%, 50%, .1) 70%, hsla(24, 20%, 50%, 0)); |
| 24 |
pointer-events: none; |
| 25 |
line-height: inherit; |
| 26 |
white-space: pre; |
| 27 |
|
| 28 |
@media print { |
| 29 |
print-color-adjust: exact; |
| 30 |
} |
| 31 |
|
| 32 |
&:before, &[data-end]]:after { |
| 33 |
content: attr(data-start); |
| 34 |
position: absolute; |
| 35 |
top: .4em; |
| 36 |
left: .6em; |
| 37 |
min-width: 1em; |
| 38 |
padding: 0 .5em; |
| 39 |
background-color: hsla(24, 20%, 50%, .4); |
| 40 |
color: hsl(24, 20%, 95%); |
| 41 |
font: bold 65%/1.5 sans-serif; |
| 42 |
text-align: center; |
| 43 |
vertical-align: .3em; |
| 44 |
border-radius: 999px; |
| 45 |
text-shadow: none; |
| 46 |
box-shadow: 0 1px white; |
| 47 |
} |
| 48 |
|
| 49 |
&[data-end]]:after { |
| 50 |
content: attr(data-end); |
| 51 |
top: auto; |
| 52 |
bottom: .4em; |
| 53 |
} |
| 54 |
|
| 55 |
.line-numbers &:before, .line-numbers &:after { |
| 56 |
content: none; |
| 57 |
} |
| 58 |
|
| 59 |
/* Additional fixes to the behaviour of line highlighting with certain themes. */ |
| 60 |
|
| 61 |
:not(.is-style-prism-shades-of-purple) pre[class*=language-]*=language-].line-numbers & { |
| 62 |
box-sizing: border-box; |
| 63 |
padding: 0; |
| 64 |
margin: 1em 0 0; |
| 65 |
} |
| 66 |
|
| 67 |
.is-style-prism-coy-without-shadows pre[class*=language-]*=language-] & { |
| 68 |
margin-top: 0; |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
pre[id]].linkable-line-numbers span.line-numbers-rows { |
| 73 |
pointer-events: all; |
| 74 |
|
| 75 |
> span:before { |
| 76 |
cursor: pointer; |
| 77 |
} |
| 78 |
|
| 79 |
> span:hover:before { |
| 80 |
background-color: rgba(128, 128, 128, .2); |
| 81 |
} |
| 82 |
} |
| 83 |
|