hugo-theme-re-terminal/assets/css/code.scss

85 lines
1.4 KiB
SCSS
Raw Permalink Normal View History

2022-06-21 13:50:51 +00:00
.collapsable-code {
2024-07-30 15:39:09 +00:00
--border-color: color-mix(in srgb, var(--accent) 90%, #999 10%);
2022-06-21 13:50:51 +00:00
position: relative;
width: 100%;
margin: 40px 0;
input[type="checkbox"] {
position: absolute;
visibility: hidden;
}
input[type="checkbox"]:checked {
~ pre,
~ .code-toolbar pre {
height: 0;
padding: 0;
border-top: none;
}
~ .code-toolbar {
padding: 0;
border-top: none;
.toolbar {
display: none;
}
}
~ label .collapsable-code__toggle:after {
content: attr(data-label-expand);
}
}
label {
position: relative;
display: flex;
justify-content: space-between;
min-width: 30px;
min-height: 30px;
margin: 0;
2024-07-30 15:39:09 +00:00
border-bottom: 1px solid var(--border-color);
2022-06-21 13:50:51 +00:00
cursor: pointer;
}
&__title {
flex: 1;
2024-07-30 15:39:09 +00:00
color: var(--accent);
2022-06-21 13:50:51 +00:00
padding: 3px 10px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
&__language {
2024-07-30 15:39:09 +00:00
color: var(--accent);
border: 1px solid var(--border-color);
2022-06-21 13:50:51 +00:00
border-bottom: none;
text-transform: uppercase;
padding: 3px 10px;
}
&__toggle {
2024-07-30 15:39:09 +00:00
color: var(--accent);
2022-06-21 13:50:51 +00:00
font-size: 16px;
padding: 3px 10px;
&:after {
content: attr(data-label-collapse);
}
}
pre {
margin-top: 0;
&::first-line {
line-height: 0;
}
}
.code-toolbar {
margin: 0;
}
}