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 / admin / faq-builder / utils / rich-text-editor.scss

rich-text-editor.scss in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/admin/faq-builder/utils/rich-text-editor.scss

473 lines 14.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Styles for the WordPress classic editor (TinyMCE + QuickTags) embedded in
2 // the FAQ Builder.
3 //
4 // Structure (rounded borders, spacing, the Visual/Code segmented tabs) is
5 // kept, but COLORS use the default editor palette — neutral greys, not
6 // BetterDocs brand colors. The one exception is the Visual / Code tab text
7 // and its hover, which keep the BetterDocs green (--base-color-700) per
8 // design request.
9
10 // Prefixed with the `.betterdocs-admin` body class (Admin.php) so every nested
11 // rule gets +1 class of specificity — enough to override TinyMCE's own
12 // `.mce-*` / `.wp-editor-*` stylesheet rules without per-rule !important. The
13 // dark-mode block below keeps its extra `.betterdocs-dark-mode` class, so it
14 // still wins over this one.
15 .betterdocs-admin .betterdocs-faq-wrapper .bd-faq-editor {
16 // Override .bd-faq-editor { height: 200px } from utils/_editor.scss
17 // (kept for back-compat); the classic editor needs to size to its own
18 // toolbar + content + status bar height.
19 width: 100%;
20 height: auto;
21 min-height: 0;
22
23 &.bd-faq-editor-wp {
24 // ---------------------------------------------------------------
25 // Outer wrap
26 // ---------------------------------------------------------------
27 .wp-editor-wrap {
28 display: block;
29 width: 100%;
30 background: #fff;
31 border: 1px solid #dcdcde;
32 border-radius: 5px;
33 transition: border-color 0.15s ease-in-out;
34 }
35
36 // ---------------------------------------------------------------
37 // Top toolbar row: Add Media (left) + Visual / Code tabs (right)
38 // ---------------------------------------------------------------
39 .wp-editor-tools {
40 background: var(--page-background);
41 border: none;
42 border-bottom: 1px solid #dcdcde;
43 border-radius: 5px 5px 0 0;
44 padding: 0px;
45 }
46
47 // Add Media button — default WordPress secondary button look
48 .wp-media-buttons {
49 margin: 0;
50
51 .button.insert-media,
52 .button {
53 display: inline-flex;
54 align-items: center;
55 gap: 6px;
56 min-height: 32px;
57 margin: 8px 12px;
58 padding: 4px 12px;
59 background: #f6f7f7;
60 color: #1E1E1E;
61 border: 1px solid #DCDCDE;
62 border-radius: 4px;
63 font-size: 12px;
64 font-weight: 500;
65 line-height: 1.4;
66 box-shadow: none;
67 cursor: pointer;
68 transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
69
70 .wp-media-buttons-icon {
71 margin: 0;
72 color: inherit;
73
74 &::before {
75 color: inherit;
76 font-size: 16px;
77 line-height: 1;
78 vertical-align: middle;
79 }
80 }
81
82 &:hover,
83 &:focus {
84 background: #f0f0f1;
85 color: #0a4b78;
86 border-color: #0a4b78;
87 box-shadow: none;
88
89 .wp-media-buttons-icon {
90 color: #0a4b78;
91 }
92 }
93 }
94 }
95
96 // Visual / Code tab switches — white bordered segmented control.
97 // EXCEPTION: the tab button color + hover keep the BetterDocs green.
98 .wp-editor-tabs {
99 background: var(--base-background, #fff);
100 border: 1px solid var(--text-color-200);
101 border-radius: 8px;
102 margin: 6px 12px;
103 padding: 3px;
104 overflow: hidden;
105
106 .wp-switch-editor {
107 float: left;
108 position: static;
109 top: auto;
110 height: auto;
111 margin: 0;
112 padding: 5px 14px;
113 background: transparent;
114 border: none;
115 border-radius: 6px;
116 color: var(--base-color-700);
117 font-size: 13px;
118 font-weight: 600;
119 line-height: 1.4;
120 cursor: pointer;
121 transition: background-color 0.15s ease, color 0.15s ease;
122
123 &:hover {
124 color: var(--base-color-700);
125 background: transparent;
126 box-shadow: none;
127 }
128
129 &:focus {
130 outline: none;
131 box-shadow: none;
132 }
133 }
134 }
135
136 // Active tab — soft green pill, green text (tabs exception).
137 &.tmce-active .switch-tmce,
138 &.html-active .switch-html,
139 .tmce-active .switch-tmce,
140 .html-active .switch-html {
141 background: var(--base-color-75);
142 color: var(--base-color-700);
143 border-color: transparent;
144 box-shadow: none;
145 }
146
147 // ---------------------------------------------------------------
148 // Editor body (TinyMCE iframe + QuickTags textarea)
149 // ---------------------------------------------------------------
150 .wp-editor-container {
151 border: none;
152 background: #fff;
153 border-radius: 0 0 5px 5px;
154 overflow: hidden;
155 box-shadow: none;
156 }
157
158 .mce-tinymce {
159 box-shadow: none;
160 border-radius: 0;
161 }
162
163 // TinyMCE renders the toolbar drop-shadow via this pseudo-element.
164 .mce-top-part::before {
165 box-shadow: none;
166 }
167
168 // TinyMCE toolbar — keep WP defaults with a subtle separator.
169 .mce-toolbar-grp {
170 background: #fff !important;
171 border-bottom: 1px solid #dcdcde !important;
172 }
173
174 .mce-toolbar .mce-btn-group {
175 margin: 0;
176 padding: 2px 6px;
177 }
178
179 // -----------------------------------------------------------
180 // Toolbar buttons — default neutral hover + subtle pressed
181 // active state (standard editor look, no inverted/brand colors).
182 // -----------------------------------------------------------
183 .mce-toolbar .mce-btn-group .mce-btn {
184 border: 1px solid transparent !important;
185 border-radius: 4px !important;
186 background: transparent !important;
187 color: #50575e !important;
188 transition: background-color 0.12s ease, color 0.12s ease,
189 box-shadow 0.12s ease, border-color 0.12s ease;
190
191 button {
192 color: inherit !important;
193 }
194
195 i,
196 .mce-ico {
197 color: #50575e !important;
198 }
199
200 // Hover / keyboard focus — light grey
201 &:hover,
202 &:focus {
203 background: #f0f0f1 !important;
204 color: #1e1e1e !important;
205 border-color: transparent !important;
206 box-shadow: none !important;
207 outline: none !important;
208
209 i,
210 .mce-ico {
211 color: #1e1e1e !important;
212 }
213 }
214
215 // Active (formatting applied at the caret) — subtle pressed grey.
216 &.mce-active,
217 &:active {
218 background: #dcdcde !important;
219 color: #1e1e1e !important;
220 border-color: transparent !important;
221 box-shadow: none !important;
222
223 button,
224 i,
225 .mce-ico,
226 .mce-txt {
227 color: #1e1e1e !important;
228 }
229 }
230
231 // Active + hover — slightly darker pressed grey.
232 &.mce-active:hover,
233 &.mce-active:focus {
234 background: #c3c4c7 !important;
235 color: #1e1e1e !important;
236 border-color: transparent !important;
237 }
238
239 // Disabled — neutral, dim
240 &.mce-disabled,
241 &[aria-disabled="true"]="true""] {
242 background: transparent !important;
243 color: #a7aaad !important;
244 opacity: 0.5 !important;
245
246 i,
247 .mce-ico {
248 color: #a7aaad !important;
249 }
250 }
251 }
252
253 // Paragraph / format-select dropdown — same neutral treatment
254 .mce-toolbar .mce-btn-group .mce-listbox {
255 background: #fff !important;
256 border: 1px solid #dcdcde !important;
257 border-radius: 4px !important;
258 color: #1e1e1e !important;
259
260 &:hover,
261 &:focus {
262 background: #f6f7f7 !important;
263 border-color: #c3c4c7 !important;
264 box-shadow: none !important;
265 }
266 }
267
268 .mce-statusbar {
269 background: #fff !important;
270 border-top: 1px solid #dcdcde !important;
271 // Drop TinyMCE's default bottom shadow; keep just the plain border.
272 box-shadow: none !important;
273 color: #757575;
274 }
275
276 .mce-edit-area {
277 background: #fff;
278 }
279
280 // QuickTags toolbar (Text/Code mode) — default neutral buttons
281 .quicktags-toolbar {
282 background: #fff;
283 border: none;
284 border-bottom: 1px solid #dcdcde;
285 padding: 8px 10px;
286
287 input.ed_button.button.button-small {
288 background: #f6f7f7;
289 border: 1px solid #dcdcde;
290 border-radius: 3px;
291 color: #50575e;
292 font-size: 12px;
293 font-weight: 500;
294 padding: 4px 10px;
295 margin: 0 4px 4px 0;
296 box-shadow: none;
297 cursor: pointer;
298 transition: all 0.15s ease;
299
300 &:hover,
301 &:focus {
302 color: #1e1e1e;
303 border-color: #c3c4c7;
304 background: #f0f0f1;
305 box-shadow: none;
306 outline: none;
307 }
308 }
309 }
310
311 // Code-mode textarea
312 .wp-editor-area {
313 border: none;
314 box-shadow: none;
315 outline: none;
316 font-family: Menlo, Consolas, Monaco, monospace;
317 font-size: 13px;
318 line-height: 1.6;
319 padding: 14px 16px;
320 color: #1e1e1e;
321 background: #fff;
322 min-height: 120px;
323 width: 100%;
324 box-sizing: border-box;
325 resize: vertical;
326
327 &:focus {
328 outline: none;
329 box-shadow: none;
330 }
331 }
332 }
333 }
334
335 // ---------------------------------------------------------------------------
336 // Dark mode — the chrome above uses light defaults; remap to a dark surface
337 // when the admin is in dark mode. Light mode is left untouched. The iframe
338 // content (TinyMCE body) is themed separately via content_style in
339 // TextEditor.js (the iframe can't read these styles).
340 // ---------------------------------------------------------------------------
341 .betterdocs-admin.betterdocs-dark-mode
342 .betterdocs-faq-wrapper
343 .bd-faq-editor.bd-faq-editor-wp {
344 .wp-editor-wrap {
345 background: #0c0f14;
346 border-color: #2a313c;
347 }
348
349 .wp-editor-tools {
350 background: #151a22;
351 border-bottom-color: #2a313c;
352 }
353
354 .wp-media-buttons {
355 .button.insert-media,
356 .button {
357 background: #1b212b;
358 color: #e6e8eb;
359 border-color: #2a313c;
360 .wp-media-buttons-icon {
361 color: #aab0ba;
362 }
363 &:hover,
364 &:focus {
365 background: #232a35;
366 color: #fff;
367 border-color: #3a4250;
368 .wp-media-buttons-icon {
369 color: #fff;
370 }
371 }
372 }
373 }
374
375 // Visual / Code tabs — dark container; active pill keeps the green family
376 // (base-color-75 → dark navy, base-color-700 → green).
377 .wp-editor-tabs {
378 background: #151a22;
379 border-color: #2a313c;
380 }
381
382 .wp-editor-container {
383 background: #0c0f14;
384 }
385
386 .mce-toolbar-grp {
387 background: #0c0f14 !important;
388 border-bottom-color: #2a313c !important;
389 }
390
391 .mce-toolbar .mce-btn-group .mce-btn {
392 color: #aab0ba !important;
393 i,
394 .mce-ico {
395 color: #aab0ba !important;
396 }
397 &:hover,
398 &:focus {
399 background: #232a35 !important;
400 color: #fff !important;
401 i,
402 .mce-ico {
403 color: #fff !important;
404 }
405 }
406 &.mce-active,
407 &:active {
408 background: #2c3543 !important;
409 color: #fff !important;
410 button,
411 i,
412 .mce-ico,
413 .mce-txt {
414 color: #fff !important;
415 }
416 }
417 &.mce-active:hover,
418 &.mce-active:focus {
419 background: #36404f !important;
420 }
421 &.mce-disabled,
422 &[aria-disabled="true"]="true""] {
423 color: #5b616c !important;
424 i,
425 .mce-ico {
426 color: #5b616c !important;
427 }
428 }
429 }
430
431 .mce-toolbar .mce-btn-group .mce-listbox {
432 background: #151a22 !important;
433 border-color: #2a313c !important;
434 color: #e6e8eb !important;
435 &:hover,
436 &:focus {
437 background: #1b212b !important;
438 border-color: #3a4250 !important;
439 }
440 }
441
442 .mce-statusbar {
443 background: #0c0f14 !important;
444 border-top-color: #2a313c !important;
445 color: #aab0ba;
446 }
447
448 .mce-edit-area {
449 background: #0c0f14;
450 }
451
452 .quicktags-toolbar {
453 background: #0c0f14;
454 border-bottom-color: #2a313c;
455 input.ed_button.button.button-small {
456 background: #1b212b;
457 color: #aab0ba;
458 border-color: #2a313c;
459 &:hover,
460 &:focus {
461 background: #232a35;
462 color: #fff;
463 border-color: #3a4250;
464 }
465 }
466 }
467
468 .wp-editor-area {
469 background: #0c0f14;
470 color: #e6e8eb;
471 }
472 }
473