mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 20:13:49 +01:00
feat: add style to new codeblock
This commit is contained in:
parent
7b2fda70a4
commit
7a710cbb55
1 changed files with 28 additions and 20 deletions
|
@ -286,10 +286,12 @@
|
|||
line-height: 1.428571429;
|
||||
word-break: break-all;
|
||||
padding: var(--card-padding);
|
||||
|
||||
// keep Codeblocks LTR
|
||||
[dir="rtl"] & {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
code {
|
||||
color: unset;
|
||||
border: none;
|
||||
|
@ -303,15 +305,11 @@
|
|||
padding: var(--card-padding);
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
.copyCodeButton {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
// keep Codeblocks LTR
|
||||
[dir="rtl"] & {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: initial;
|
||||
padding: 0;
|
||||
|
@ -320,20 +318,30 @@
|
|||
}
|
||||
}
|
||||
|
||||
.copyCodeButton {
|
||||
position: absolute;
|
||||
top: calc(var(--card-padding));
|
||||
right: calc(var(--card-padding));
|
||||
background: var(--card-background);
|
||||
border: none;
|
||||
box-shadow: var(--shadow-l2);
|
||||
border-radius: var(--tag-border-radius);
|
||||
padding: 8px 16px;
|
||||
color: var(--card-text-color-main);
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
.codeblock {
|
||||
header {
|
||||
background-color: var(--card-background-selected);
|
||||
padding: 5px var(--card-padding);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-shadow: var(--shadow-l1);
|
||||
|
||||
span {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
color: var(--card-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.codeblock-copy {
|
||||
cursor: pointer;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
color: var(--card-text-color-secondary);
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.table-wrapper {
|
||||
|
@ -402,7 +410,7 @@
|
|||
/// Negative margins
|
||||
blockquote,
|
||||
figure,
|
||||
.highlight,
|
||||
.codeblock,
|
||||
pre,
|
||||
.gallery,
|
||||
.video-wrapper,
|
||||
|
|
Loading…
Reference in a new issue