Files
schleppe-lab/_sass/_post.scss
Kevin Midboe 5278b4bfd8 Align code block to new color scheme
Codeblock with line numbers change format of copy code button, updated.
2024-02-18 13:14:57 +01:00

122 lines
1.8 KiB
SCSS

/**
* Code formatting
*/
pre,
code {
font-size: 0.9375em;
border: 1px solid hsla(0, 0%, 100%, 0.1);
padding: 3em;
// background-color: var(--background-color);
}
code {
padding: 1px 5px;
background-color: rgba(255, 168, 106, 0.2);
background-color: rgba(8,76,207,.1);
color: var(--brand-color);
margin: 0 2px;
padding: 1px 6px;
border: none;
}
figure.highlight {
@include border-accent;
> pre {
// padding: 0;
margin-bottom: 0;
> code {
background-color: unset;
color: unset;
margin: 0;
padding: 0;
border: none;
}
}
}
figure#highlight-figure {
position: relative;
> figcaption {
position: absolute;
bottom: 0.5rem;
z-index: 1;
}
}
.rouge-table {
> pre {
overflow-x: auto;
@include border-accent;
}
.lineno {
text-align: right;
border-right-color: lightgrey;
margin-left: -2rem;
padding-right: 0.5rem;
margin-right: 0.5rem;
}
td > pre {
padding: 0;
// padding: 1rem 0.5rem;
}
&:not(.lineno) {
border-left: none;
}
}
figure.highlight {
position: relative;
table {
border-collapse: collapse;
margin-bottom: 0;
td {
padding: 0;
border-style: hidden !important;
}
}
}
.highlight > button {
all: unset;
opacity: 0;
position: absolute;
top: 0.3rem;
right: 1rem;
z-index: 100;
cursor: pointer;
background: hsla(0, 0%, 87.8%, 0.8) !important;
border-radius: 0 !important;
box-shadow: 0 2px 0 0 rgba(8,76,207,.5) !important;
color: black;
font-size: 0.8em !important;
margin: 6px !important;
padding: 0.5rem 0.8rem;
transition: all 0.5s ease;
}
.highlight:hover > button {
opacity: 1;
}
.highlight > button:active,
.highlight > button:focus {
opacity: 1;
}
.changelog {
float: right;
}