-
Notifications
You must be signed in to change notification settings - Fork 10
/
Code Blocks.css
141 lines (120 loc) · 3.65 KB
/
Code Blocks.css
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*----------------------------------------------------------------
CODEBLOCKS & INLINE CODE
----------------------------------------------------------------*/
.cm-s-obsidian pre.HyperMD-codeblock-begin {
padding-top: 0.75rem;
}
/* Preview code block background */
.markdown-preview-view pre {
padding: 1em;
border-radius: 4px;
border: 1px solid var(--code-block-border);
white-space: pre-wrap;
}
/* Code block border color */
.cm-s-obsidian div.HyperMD-codeblock-begin-bg {
border-top: 1px solid var(--code-block-border);
padding: 1em !important;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
/* Code block border color */
.cm-s-obsidian div.HyperMD-codeblock-end-bg {
border-bottom: 1px solid var(--code-block-border);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
/* Code block left and right border colors */
.cm-s-obsidian div.HyperMD-codeblock-bg {
border-left: 1px solid var(--code-block-border);
border-right: 1px solid var(--code-block-border);
}
.copy-code-button {
color: var(--text-normal) !important;
font-family: var(--font-monospace) !important;
background-color: var(--background-modifier-border) !important;
border: 1px solid var(--code-block-border) !important;
border-radius: 0px 0px 0px 0px !important;
display: block;
text-transform: lowercase !important;
font-weight: 500 !important;
margin-left: auto;
margin-right: 0;
margin-bottom: -2px;
padding: 3px 12px !important;
font-size: 0.8em;
position: absolute;
top: 0px;
right: 0px;
}
.copy-code-button:hover{
background-color: var(--background-secondary-alt) !important;
}
/*----------------------------------------------------------------
EDITOR SECTION
----------------------------------------------------------------*/
.theme-dark code[class*="language-"],
.theme-dark pre[class*="language-"],
.theme-light code[class*="language-"],
.theme-light pre[class*="language-"]{
text-shadow: none !important;
background-color: var(--pre-code) !important;
}
.cm-s-obsidian,
.cm-inline-code{
-webkit-font-smoothing: auto !important;
font-size: 17px !important; /*text size of inline code in editor*/
}
.cm-inline-code{
font-family: var(--font-monospace) !important;
color: var(--inline-code) !important;
background-color: var(--pre-code) !important;
padding: 1px !important;
}
.HyperMD-codeblock-bg{
background-color: var(--pre-code) !important;
}
.cm-hmd-codeblock{
font-size: 17px;
}
.HyperMD-codeblock{
font-family: var(--font-monospace) !important;
line-height: 1.5em !important;
color: var(--code-block) !important;
}
.HyperMD-codeblock-begin{
border-style: none;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.HyperMD-codeblock-end{
border-style: none;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
/*----------------------------------------------------------------
PREVIEW SECTION
----------------------------------------------------------------*/
.markdown-preview-section pre{
display: block;
margin: 1.25em 0em !important;
}
.markdown-preview-section pre code,
.markdown-preview-section code{
font-family: var(--font-monospace) !important;
font-size: 100% !important; /*SIZE OF CODE BLOCK TEXT IN PREVIEW*/
background-color: var(--pre-code) !important;
}
.markdown-preview-section pre code{
padding: 4px !important;
line-height: 1.5em !important;
display: block !important;
color: var(--code-block) !important;
}
/*styling basic code blocks*/
.markdown-preview-section code{
border-style: none;
border-width: .2px;
border-color: var(--inline-code);
color: var(--inline-code) !important;
}