PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.1.17
Adminify – White Label, Admin Menu Editor, Login Customizer v4.1.17
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Classes / DarkModeConflicts.php

DarkModeConflicts.php in Adminify – White Label, Admin Menu Editor, Login Customizer 4.1.17, at Inc/Classes/DarkModeConflicts.php

419 lines 13.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Classes;
4
5 use WPAdminify\Inc\Utils;
6 use WPAdminify\Inc\Admin\AdminSettings;
7
8 // no direct access allowed
9 if (!defined('ABSPATH')) {
10 exit;
11 }
12 /**
13 * WPAdminify
14 * Dark Mode Conflicts with other plugins supports
15 *
16 * @author Jewel Theme <support@jeweltheme.com>
17 */
18
19 class DarkModeConflicts
20 {
21 public $options;
22
23 public function __construct()
24 {
25 add_action('admin_enqueue_scripts', array($this, 'jltwp_adminify_darkmode_scripts'), 100);
26 add_action( 'enqueue_block_editor_assets', array($this, "jltwp_gutenberg_block_editor_darkmode_assets"));
27 }
28
29 public function jltwp_adminify_darkmode_scripts()
30 {
31
32 $this->options = (array) AdminSettings::get_instance()->get();
33 $this->options = !empty($this->options['light_dark_mode']['admin_ui_mode']) ? $this->options['light_dark_mode']['admin_ui_mode'] : '';
34
35 if ($this->options == 'light') {
36 return;
37 }
38
39
40 $dark_mode_style = '.ReactModal__Content,
41 .select2-selection,
42 .select2-results__options,
43 .adminify-dark-mode.toplevel_page_aio-contact-lite,
44 .aio-contact-menu,
45 .bsr-action-form input.regular-text,
46 .select2-dropdown,
47 .form-cancel-btn,
48 .folders-tabs,
49 .folder-tab-menu,
50 .folder-tab-menu a,
51 .custom-checkbox span,
52 .preview-inner-box,
53 .preview-inner-box .form-options,
54 .media-buttons,
55 .popup-form-content,
56 .select2-results__option,
57 div.tagsinput,
58 .settings-tabs-list .nav-tab,
59 input[type=number],
60 .bulk-action-select .bulk-action-select__control,
61 .bulk-action-select__menu,
62 .wprf-section-fields,
63 .wprf-section-title,
64 .wprf-input-radio-option:not(.wprf-option-selected) .wprf-input-label,
65 .wprf-control-field .components-button,
66 .wprf-select__menu,
67 .wprf-select__control,
68 .wprf-tab-content,
69 .squirrly-seo-settings #wpcontent .bg-light,
70 .bootstrap-select,
71 .bg-white,
72 .wdt-addons-intro {
73 background: white !important;
74 }
75
76 .el-checkbox.is-checked ~ div,
77 .fluentcrm_header {
78 background: none!important;
79 }
80
81 .folder-user-settings .pro-feature-popup {
82 background: rgb(0, 0, 0, 0.4)
83 }
84
85 .big-pluspro-btn,
86 .dokan-btn,
87 .close_dp_help,
88 .dup-btn,
89 .folder-tab-menu a,
90 .pro-feature-popup .pro-feature-content > a,
91 .user-upgrade-inline-btn,
92 .pro-feature-popup .pro-feature-content .pro-user-title,
93 .pro-feature-popup .pro-feature-content .pro-user-desc,
94 .folder-access,
95 .add-new-folder,
96 .media-select option,
97 .popup-form-content,
98 .nf-button:hover,
99 .wp-react-form h1,
100 .wp-react-form h2,
101 .wp-react-form h3,
102 .wp-react-form h4,
103 .wprf-input-label,
104 .wprf-tab-nav-item:not(:hover),
105 .swift-btn,
106 .wpcode-button,
107 .wdt-constructor-type-selecter-block .card-body h4,
108 .wdt-constructor-type-selecter-block .card-body h4 span,
109 .yoast-button-upsell,
110 .aioseo-button:hover,
111 .el-button {
112 color: white !important;
113 }
114
115 .folders-tabs .dashicons-editor-help,
116 .folder-tab-menu a.active,
117 .folder-list li a span,
118 .select2-selection__rendered,
119 .fp-item-name,
120 .select2-results__option,
121 .form-sample,
122 input[type=number],
123 .wprf-select__single-value,
124 .wprf-code-viewer textarea,
125 .wdt-constructor-type-selecter-block .card-body span,
126 .mce-menu-item > span {
127 color: gray !important;
128 }
129
130 .select2-selection,
131 .bsr-action-form input.regular-text,
132 #bsr-table-select,
133 .custom-checkbox input+span,
134 .preview-inner-box,
135 div.tagsinput,
136 input[type=number],
137 .bulk-action-select .bulk-action-select__control,
138 .wprf-tab-nav-item,
139 .wprf-control-field .components-button,
140 .wprf-select__control,
141 .wprf-control-field input[type="checkbox"],
142 .bootstrap-select {
143 border-color: #D0D5DD !important;
144 }
145
146 .dokan-admin-header-logo img,
147 .dup-header img {
148 filter: grayscale(1) brightness(5);
149 }
150
151 .jetpack-logo,
152 .it-ui-list div[direction="horizontal"] > svg {
153 fill: black !important;
154 }
155
156 .jp-form-block-fade {
157 opacity: 0.5;
158 }
159 ';
160
161 // Elementor Style issues
162 // if (Utils::is_plugin_active('elementor/elementor.php')) {
163 // $dark_mode_style .= '.darkmode{
164 // background: white !important;
165 // }';
166 // }
167
168 // Better Links Style issues
169 if (Utils::is_plugin_active('betterlinks/betterlinks.php')) {
170 $dark_mode_style .= '#betterlinksbody .kpyoXL,
171 .btl-react-select__menu,
172 #betterlinksbody .jlDjrx {
173 background: white !important;
174 }
175 #betterlinksbody .kpyoXL{
176 color: white !important;
177 }
178 ';
179 }
180
181 // Forminator Style issues
182 if (Utils::is_plugin_active('forminator/forminator.php')) {
183 $dark_mode_style .= '.sui-box,
184 .sui-icon-plugin-2,
185 .sui-vertical-tab a.current,
186 .sui-wrap .fui-multi-answers,
187 .sui-wrap .fui-multi-answers .fui-answers>li,
188 .sui-dropdown.open ul,
189 .sui-notice-content,
190 .sui-wrap .sui-box-selectors,
191 .sui-select-dropdown,
192 .sui-accordion-item,
193 .sui-tabs-menu,
194 .forminator-addon-card--footer,
195 .sui-vertical-tab.current,
196 .sui-form-control,
197 select#forminator-field-user_role,
198 .forminator-save-field-settings {
199 background: white !important;
200 }
201
202 .sui-upgrade-page,
203 .sui-upgrade-page-header,
204 .sui-upgrade-page-cta {
205 background: none!important;
206 }
207
208 .sui-header-title,
209 .sui-summary-large,
210 .sui-list-label,
211 .sui-box-title,
212 .sui-wrap h1,
213 .sui-wrap h2,
214 .sui-wrap h3,
215 .sui-button,
216 .sui-vertical-tab a.current,
217 .sui-table thead>tr>th,
218 .sui-trim-text,
219 .sui-message-content h2,
220 .sui-tab-item.active,
221 .sui-vertical-tab.current a,
222 select#forminator-field-user_role {
223 color: white !important;
224 }
225
226 .sui-upsell-list li,
227 .sui-table-item-title,
228 .sui-vertical-tab a,
229 .sui-form-control,
230 .sui-settings-label {
231 color: gray !important;
232 }
233
234 .sui-list li,
235 .sui-box-header,
236 #sui-cross-sell-footer>div,
237 .sui-box-settings-row,
238 .sui-dropdown.open ul,
239 .sui-box-footer,
240 .sui-status-changes,
241 .sui-table thead>tr>th,
242 .sui-select-dropdown,
243 .sui-tab-content,
244 .forminator-addon-card--footer,
245 .sui-table.fui-table--apps,
246 .sui-table tbody>tr>td,
247 .sui-tabs-overflow,
248 .sui-form-control,
249 .sui-button,
250 select#forminator-field-user_role {
251 border-color: #D0D5DD !important;
252 }
253
254 .sui-dropdown.open ul::after,
255 .sui-dropdown.open ul::before {
256 border-color: #D0D5DD rgba(0, 0, 0, 0)!important;
257 }
258
259 .sui-box,
260 .sui-accordion-item,
261 .sui-tabs-menu {
262 box-shadow: none!important;
263 }
264
265 .sui-chartjs-message--empty {
266 background-blend-mode: exclusion;
267 }
268
269 .sui-tag,
270 .sui-tabs-menu .sui-tab-item {
271 background: #6f6f6f!important;
272 color: #fff!important;
273 }
274
275 .sui-tab-item.active {
276 background: black!important;
277 }
278 ';
279 }
280
281 // Loginpress
282 if (Utils::is_plugin_active('loginpress/loginpress.php')) {
283 $dark_mode_style .= '.loginpress-help-page pre textarea,
284 .loginpress-import-export-page .upload-file,
285 .loginpress-extension {
286 background: white !important;
287 }
288
289 .toplevel_page_loginpress-settings #wpcontent,
290 .loginpress_page_loginpress-help #wpcontent,
291 .loginpress_page_loginpress-import-export #wpcontent,
292 .loginpress-header-wrapper,
293 .loginpress-settings {
294 background: none!important;
295 }
296
297 .loginpress-help-page h2,
298 .loginpress-import-export-page h2,
299 .loginpress-addons-wrap h2,
300 .loginpress-extension h3 span,
301 .loginpress-settings h3{
302 color: white !important;
303 }
304
305 .loginpress-help-page pre textarea,
306 .loginpress-import-export-page > div,
307 .loginpress-settings .form-table tr th,
308 .loginpress-settings .form-table tr td fieldset label {
309 color: gray !important
310 }
311
312 .loginpress-help-page pre textarea,
313 .loginpress-import-export-page .upload-file,
314 .loginpress-extension h3,
315 .loginpress-extension {
316 border-color: #D0D5DD !important;
317 }
318
319 .loginpress-header-logo img {
320 filter: grayscale(1) brightness(5);
321 }
322
323 ';
324 }
325
326 // Notificationx Style issues
327 if (Utils::is_plugin_active('notificationx/notificationx.php')) {
328 $dark_mode_style .= '.nx-analytics-counter,
329 #notificationx .notificationx-items .nx-admin-menu>ul li:not(.nx-active) a,
330 .nx-admin-sidebar .sidebar-widget,
331 .nx-settings-right,
332 .nx-admin-block,
333 .nx-sidebar,
334 .nx-quick-builder-wrapper {
335 background: white !important;
336 }
337
338 .nx-button:not(:hover) {
339 background: none!important;
340 }
341
342 .nx-counter-number,
343 .nx-admin-title {
344 color: white !important;
345 }
346
347 #notificationx .notificationx-items .nx-admin-menu>ul li:not(.nx-active) a,
348 #nx-title,
349 #notification-template,
350 .nx-admin-sidebar-cta a:not(:hover) {
351 color: gray !important;
352 }
353
354 #notificationx .notificationx-items .nx-admin-menu>ul li:not(.nx-active) a,
355 #nx-title,
356 .nx-widget-title,
357 #notification-template {
358 border-color: #D0D5DD !important;
359 }
360
361 .nx-admin-sidebar-logo img {
362 filter: grayscale(1) brightness(5);
363 }
364
365 .nx-admin-header svg g {
366 fill: #fff!important;
367 }
368 ';
369 }
370
371 // Wpdatatables Style issues
372 if (Utils::is_plugin_active('wpdatatables/wpdatatables.php')) {
373 $dark_mode_style .= '.wpdt-c.toplevel_page_wpdatatables-dashboard,
374 .wpdt-c .wdt-datatables-admin-wrap .plugin-dashboard,
375 .wpdt-c.wpdatatables_page_wpdatatables-administration,
376 .card-header.wdt-admin-card-header.ch-alt,
377 #wdt-datatables-browse-table,
378 .manage-column,
379 .wpdt-c.wpdatatables_page_wpdatatables-constructor,
380 .wdt-constructor-type-selecter-block .card-header,
381 .wpdt-c,
382 .chart-wizard-breadcrumb,
383 .wpdt-c .chart-name,
384 .wpdt-c .render-engine {
385 background: white !important;
386 }
387
388 ';
389 }
390
391
392
393 $dark_mode_style = preg_replace('#/\*.*?\*/#s', '', $dark_mode_style);
394 $dark_mode_style = preg_replace('/\s*([{}|:;,])\s+/', '$1', $dark_mode_style);
395 $dark_mode_style = preg_replace('/\s\s+(.*)/', '$1', $dark_mode_style);
396 wp_add_inline_style('wp-adminify-admin', wp_strip_all_tags($dark_mode_style));
397 }
398
399 /**
400 * Gutenberg Block Editor Dark Mode CSS
401 */
402 function jltwp_gutenberg_block_editor_darkmode_assets () {
403 wp_register_style('wp-adminify-gutenberg-dark', false);
404 wp_enqueue_style('wp-adminify-gutenberg-dark');
405
406 // $parent_selector = 'body.wp-adminify.adminify-dark-mode';
407 $parent_selector = 'body.wp-adminify';
408
409 $dark_mode_style = "$parent_selector .components-modal__content .components-text,
410 $parent_selector .components-popover__content .components-text { color: black!important; }
411 $parent_selector .block-editor-block-inspector .components-tools-panel { border-top-color: #e0e0e0; }
412 $parent_selector .admin-ui-navigable-region .components-panel__header > div > button { color: black; }
413 $parent_selector .editor-sidebar__panel .editor-post-card-panel__header svg,
414 $parent_selector .commands-command-menu__container .commands-command-menu__header svg { fill: black; }
415 ";
416 wp_add_inline_style('wp-adminify-gutenberg-dark', wp_strip_all_tags($dark_mode_style));
417 }
418 }
419