PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.2.4.1
Adminify – White Label, Admin Menu Editor, Login Customizer v3.2.4.1
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 3.2.4.1, at Inc/Classes/DarkModeConflicts.php

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