Copy btn on code blocks, tweaked code block styling

This commit is contained in:
2023-07-09 22:28:26 +02:00
parent 0f123651fb
commit a43f2463e2
5 changed files with 75 additions and 68 deletions

View File

@@ -151,71 +151,6 @@ blockquote {
}
}
/**
* 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);
color: var(--brand-color);
margin: 0 2px;
padding: 1px 6px;
border: none;
}
pre {
padding: 8px 12px;
padding: 1.25em;
overflow-x: auto;
> code {
background-color: unset;
border: 0;
padding-right: 0;
padding-left: 0;
}
}
.highlight {
position: relative;
}
.highlight > button {
all: unset;
opacity: 0;
position: absolute;
top: 1rem;
right: 1rem;
z-index: 100;
cursor: pointer;
background: hsla(0, 0%, 87.8%, 0.2) !important;
border-radius: 0 !important;
box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2) !important;
color: #bbb !important;
font-size: 0.8em !important;
margin: 6px !important;
padding: 10px !important;
transition: opacity 0.5s ease;
}
.highlight:hover > button {
opacity: 1;
}
.highlight > button:active,
.highlight > button:focus {
opacity: 1;
}
/**
* Clearfix
*/