PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / blocks / code-snippet / src / components / codemirror.scss

codemirror.scss in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/blocks/code-snippet/src/components/codemirror.scss

311 lines 6.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * CodeMirror Control Styles for BetterDocs Code Snippet Block
3 */
4
5 .betterdocs-codemirror-control {
6 .components-base-control__field {
7 margin-bottom: 0;
8 }
9
10 .components-base-control__label {
11 font-weight: 600;
12 margin-bottom: 8px;
13 display: block;
14 }
15
16 .components-base-control__help {
17 margin-top: 8px;
18 font-size: 12px;
19 font-style: normal;
20 color: #757575;
21 }
22
23 // Loading state
24 &.is-loading {
25 .codemirror-loading {
26 padding: 12px;
27 text-align: center;
28 background-color: #f7f7f7;
29 border: 1px solid #ddd;
30 border-radius: 4px;
31 color: #666;
32 font-size: 13px;
33 margin-bottom: 8px;
34
35 span {
36 display: inline-block;
37 position: relative;
38
39 &::after {
40 content: '';
41 display: inline-block;
42 width: 12px;
43 height: 12px;
44 margin-left: 8px;
45 border: 2px solid #ddd;
46 border-top-color: #007cba;
47 border-radius: 50%;
48 animation: codemirror-spin 1s linear infinite;
49 }
50 }
51 }
52 }
53
54 // Error state
55 &.has-error {
56 .components-base-control__help {
57 color: #d63638;
58 }
59
60 textarea {
61 border-color: #d63638;
62 }
63 }
64
65 @keyframes codemirror-spin {
66 to {
67 transform: rotate(360deg);
68 }
69 }
70
71 // Hide textarea when CodeMirror is active
72 &.is-codemirror-ready {
73 textarea {
74 display: none !important;
75 }
76 }
77
78 // Fallback textarea styling
79 textarea {
80 font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
81 font-size: 13px;
82 line-height: 1.4;
83 border: 1px solid #ddd;
84 border-radius: 4px;
85 padding: 8px;
86 resize: vertical;
87 min-height: 200px;
88 width: 100%;
89
90 &:focus {
91 border-color: #007cba;
92 box-shadow: 0 0 0 1px #007cba;
93 outline: 2px solid transparent;
94 }
95 }
96
97 // CodeMirror wrapper
98 .CodeMirror {
99 border: 1px solid #ddd;
100 border-radius: 4px;
101 font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
102 font-size: 13px;
103 line-height: 1.4;
104 height: auto;
105 min-height: 200px;
106 max-height: 500px;
107
108 &.CodeMirror-focused {
109 border-color: #007cba;
110 box-shadow: 0 0 0 1px #007cba;
111 outline: 2px solid transparent;
112 }
113
114 .CodeMirror-scroll {
115 min-height: 200px;
116 max-height: 500px;
117 }
118
119 .CodeMirror-lines {
120 padding: 8px 0;
121 }
122
123 .CodeMirror-line {
124 padding: 0 8px;
125 }
126
127 .CodeMirror-linenumber {
128 color: #999;
129 padding: 0 8px 0 0;
130 min-width: 30px;
131 }
132
133 .CodeMirror-gutters {
134 border-right: 1px solid #ddd;
135 background-color: #f7f7f7;
136 }
137
138 .CodeMirror-cursor {
139 border-left: 1px solid #000;
140 }
141
142 .CodeMirror-selected {
143 background: #d9d9d9;
144 }
145
146 .CodeMirror-selectedtext {
147 background: none;
148 }
149
150 // Placeholder styling
151 .CodeMirror-placeholder {
152 color: #999;
153 font-style: italic;
154 }
155
156 // Syntax highlighting improvements
157 .cm-keyword {
158 color: #d73a49;
159 font-weight: bold;
160 }
161
162 .cm-string {
163 color: #032f62;
164 }
165
166 .cm-comment {
167 color: #6a737d;
168 font-style: italic;
169 }
170
171 .cm-number {
172 color: #005cc5;
173 }
174
175 .cm-variable {
176 color: #24292e;
177 }
178
179 .cm-variable-2 {
180 color: #6f42c1;
181 }
182
183 .cm-def {
184 color: #6f42c1;
185 }
186
187 .cm-operator {
188 color: #d73a49;
189 }
190
191 .cm-bracket {
192 color: #24292e;
193 }
194
195 .cm-tag {
196 color: #22863a;
197 }
198
199 .cm-attribute {
200 color: #6f42c1;
201 }
202
203 .cm-property {
204 color: #005cc5;
205 }
206
207 .cm-qualifier {
208 color: #6f42c1;
209 }
210
211 .cm-builtin {
212 color: #005cc5;
213 }
214
215 .cm-atom {
216 color: #005cc5;
217 }
218 }
219
220 // Focus state for the control
221 &.is-focused {
222 .CodeMirror {
223 border-color: #007cba;
224 box-shadow: 0 0 0 1px #007cba;
225 }
226 }
227
228 // Dark theme support
229 .interface-interface-skeleton__body.is-dark-theme & {
230 .CodeMirror {
231 background-color: #1e1e1e;
232 color: #d4d4d4;
233 border-color: #3c3c3c;
234
235 .CodeMirror-gutters {
236 background-color: #252526;
237 border-right-color: #3c3c3c;
238 }
239
240 .CodeMirror-linenumber {
241 color: #858585;
242 }
243
244 .CodeMirror-cursor {
245 border-left-color: #d4d4d4;
246 }
247
248 .CodeMirror-selected {
249 background: #264f78;
250 }
251
252 .CodeMirror-placeholder {
253 color: #858585;
254 }
255
256 // Dark theme syntax highlighting
257 .cm-keyword {
258 color: #569cd6;
259 }
260
261 .cm-string {
262 color: #ce9178;
263 }
264
265 .cm-comment {
266 color: #6a9955;
267 }
268
269 .cm-number {
270 color: #b5cea8;
271 }
272
273 .cm-variable {
274 color: #9cdcfe;
275 }
276
277 .cm-variable-2 {
278 color: #c586c0;
279 }
280
281 .cm-def {
282 color: #dcdcaa;
283 }
284
285 .cm-operator {
286 color: #d4d4d4;
287 }
288
289 .cm-tag {
290 color: #569cd6;
291 }
292
293 .cm-attribute {
294 color: #92c5f8;
295 }
296
297 .cm-property {
298 color: #9cdcfe;
299 }
300 }
301 }
302
303 // Responsive adjustments
304 @media (max-width: 782px) {
305 .CodeMirror {
306 font-size: 14px;
307 min-height: 150px;
308 }
309 }
310 }
311