-
Notifications
You must be signed in to change notification settings - Fork 904
/
_code.scss
91 lines (79 loc) · 1.77 KB
/
_code.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Code formatting.
@include color-mode(dark, true) {
--td-pre-bg: #{adjust-color($gray-900, $lightness: -2.5%)};
}
.td-content {
// Highlighted code.
.highlight {
margin: 2rem 0;
padding: 0;
position: relative;
.click-to-copy {
display: block;
text-align: right;
}
pre {
margin: 0;
padding: 1rem;
border-radius: inherit;
// Default click-to-copy button
button.td-click-to-copy {
position: absolute;
color: var(--bs-tertiary-color);
border-width: 0;
background-color: transparent;
background-image: none;
--bs-btn-box-shadow: 0;
padding: var(--bs-btn-padding-y) calc(var(--bs-btn-padding-x) / 2);
right: 4px;
top: 2px;
&:hover {
color: var(--bs-secondary-color);
background-color: var(--bs-dark-bg-subtle);
}
&:active {
color: var(--bs-secondary-color);
background-color: var(--bs-dark-bg-subtle);
transform: translateY(2px);
}
}
}
}
// Inline code
p code,
li > code,
table code {
color: inherit;
padding: 0.2em 0.4em;
margin: 0;
font-size: 85%;
word-break: normal;
background-color: var(--td-pre-bg);
border-radius: $border-radius;
br {
display: none;
}
}
// Code blocks
pre {
word-wrap: normal;
background-color: var(--td-pre-bg);
border: solid var(--bs-border-color);
border-width: 1px;
padding: $spacer;
> code {
background-color: inherit !important;
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
border: 0;
}
}
pre.mermaid {
background-color: inherit;
font-size: 0;
padding: 0;
}
}