mirror of
https://github.com/maikka39/Personal-Website.git
synced 2026-10-24 06:56:59 +00:00
Properly support line numbers on highlight
This commit is contained in:
@@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
html {
|
html {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
line-height: 1.6;
|
|
||||||
letter-spacing: 0.06em;
|
letter-spacing: 0.06em;
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
@@ -570,3 +569,79 @@ table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
&:has(table) {
|
||||||
|
margin: 0.95em 0;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
display: block;
|
||||||
|
width: max-content;
|
||||||
|
min-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100% !important;
|
||||||
|
display: block;
|
||||||
|
background: inherit;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 0;
|
||||||
|
font-size: inherit;
|
||||||
|
|
||||||
|
tbody {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
tr {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
td {
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
word-break: normal;
|
||||||
|
width: 1px; // flex will override
|
||||||
|
|
||||||
|
pre {
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
@media #{$media-size-phone} {
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-of-type {
|
||||||
|
// line numbers
|
||||||
|
flex: 0 0 max-content;
|
||||||
|
|
||||||
|
.lnt {
|
||||||
|
padding-left: 14px;
|
||||||
|
padding-right: 14px;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-of-type {
|
||||||
|
// code
|
||||||
|
flex: 1 1 auto;
|
||||||
|
|
||||||
|
pre {
|
||||||
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user