Skip to content

Commit ffa53eb

Browse files
authored
Merge pull request #175 from wp-slimstat/fix/css-config-page
fix(css): admin page body class and CSS config fixes
2 parents 7b87ab0 + 60d4b77 commit ffa53eb

File tree

11 files changed

+58
-53
lines changed

11 files changed

+58
-53
lines changed

admin/assets/css/admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/assets/css/admin.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/assets/scss/admin.scss

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ body.index-php {
270270
position: relative !important;
271271
}
272272

273-
.wrap.slimstat {
273+
.wrap-slimstat {
274274
overflow-x: hidden !important;
275275

276276
.postbox:has(p.loading) a.refresh svg {
@@ -495,7 +495,7 @@ body {
495495

496496
// Old Styles
497497
/* Links */
498-
.wrap.slimstat a,
498+
.wrap-slimstat a,
499499
[id^="slim_"] a {
500500
outline: none;
501501
text-decoration: none;
@@ -651,7 +651,7 @@ body {
651651
}
652652

653653
/* Reports: Container */
654-
.wrap.slimstat .meta-box-sortables {
654+
.wrap-slimstat .meta-box-sortables {
655655
display: flex;
656656
align-items: center;
657657
justify-content: flex-start;
@@ -673,8 +673,8 @@ body {
673673
}
674674

675675
/* Single Report */
676-
.wrap.slimstat .postbox,
677-
.wrap.slimstat .sortable-placeholder {
676+
.wrap-slimstat .postbox,
677+
.wrap-slimstat .sortable-placeholder {
678678
box-sizing: border-box;
679679
float: left;
680680
margin-bottom: 15px;
@@ -683,15 +683,15 @@ body {
683683
width: 24.3%;
684684
}
685685

686-
.wrap.slimstat .postbox.large {
686+
.wrap-slimstat .postbox.large {
687687
width: 49.1%;
688688
}
689689

690-
.wrap.slimstat .postbox.extralarge {
690+
.wrap-slimstat .postbox.extralarge {
691691
width: 73.9%;
692692
}
693693

694-
.wrap.slimstat .postbox.full-width {
694+
.wrap-slimstat .postbox.full-width {
695695
width: 98.7%;
696696
}
697697

@@ -702,14 +702,14 @@ body {
702702
}
703703

704704
/* Single Report: Header and Header Buttons */
705-
.wrap.slimstat .postbox h3 {
705+
.wrap-slimstat .postbox h3 {
706706
border-bottom: 1px solid #ddd;
707707
font-size: 1.2em;
708708
margin: 0;
709709
padding: 10px;
710710
}
711711

712-
.wrap.slimstat .postbox.tall h3 {
712+
.wrap-slimstat .postbox.tall h3 {
713713
cursor: auto;
714714
}
715715

@@ -743,7 +743,7 @@ body {
743743
margin-bottom: 45px !important;
744744
}
745745

746-
.wrap.slimstat .postbox.tall .inside {
746+
.wrap-slimstat .postbox.tall .inside {
747747
height: 465px;
748748
}
749749

@@ -898,21 +898,15 @@ body {
898898
}
899899

900900
body {
901-
&.toplevel_page_slimview1,
902-
&.slimstat_page_slimview2,
903-
&.slimstat_page_slimview3,
904-
&.slimstat_page_slimview4,
905-
&.slimstat_page_slimview5,
906-
&.slimstat_page_slimconfig,
907-
&.slimstat_page_migration,
908-
&.slimstat_page_slimpro,
909-
&.slimstat_page_slimlayout {
901+
&.slimstat-admin-page {
910902
/* Hide all non-Slimstat notices in the admin */
911903
div[class*="-notice"]:not(.slimstat-notice):not(.slimstat-migration-notice),
912904
div[class*="admin-notice"]:not(.slimstat-notice):not(.slimstat-migration-notice),
913905
.notice:not(.slimstat-notice):not(.slimstat-migration-notice),
914906
.update-nag:not(.slimstat-notice):not(.slimstat-migration-notice),
915-
.error:not(.slimstat-notice):not(.slimstat-migration-notice) {
907+
.error:not(.slimstat-notice):not(.slimstat-migration-notice),
908+
.astra-notice-wrapper,
909+
.cky-admin-notice {
916910
display: none !important;
917911
}
918912
}
@@ -1148,7 +1142,7 @@ body {
11481142
right: inherit;
11491143
}
11501144

1151-
.rtl .wrap.slimstat .postbox {
1145+
.rtl .wrap-slimstat .postbox {
11521146
float: right;
11531147
}
11541148

@@ -1206,7 +1200,7 @@ body {
12061200
margin-left: 0 !important;
12071201
}
12081202

1209-
.rtl .wrap.slimstat .sortable-placeholder {
1203+
.rtl .wrap-slimstat .sortable-placeholder {
12101204
float: right;
12111205
}
12121206

@@ -1481,25 +1475,25 @@ body {
14811475

14821476
/* Responsive */
14831477
@media screen and (max-width: 1560px) {
1484-
.wrap.slimstat .postbox {
1478+
.wrap-slimstat .postbox {
14851479
width: 32.8%;
14861480
}
1487-
.wrap.slimstat .postbox.large {
1481+
.wrap-slimstat .postbox.large {
14881482
width: 66.1%;
14891483
}
1490-
.wrap.slimstat .postbox.extralarge,
1491-
.wrap.slimstat .postbox.full-width {
1484+
.wrap-slimstat .postbox.extralarge,
1485+
.wrap-slimstat .postbox.full-width {
14921486
width: 99.4%;
14931487
}
1494-
.wrap.slimstat .postbox h3 {
1488+
.wrap-slimstat .postbox h3 {
14951489
font-size: 1em;
14961490
line-height: 1.2em;
14971491
}
1498-
.wrap.slimstat .postbox p {
1492+
.wrap-slimstat .postbox p {
14991493
font-size: 1em;
15001494
line-height: 1.5em;
15011495
}
1502-
.wrap.slimstat .postbox p span.details {
1496+
.wrap-slimstat .postbox p span.details {
15031497
float: none !important;
15041498
display: block;
15051499
padding: 0px !important;
@@ -1544,12 +1538,12 @@ body {
15441538
}
15451539

15461540
@media screen and (max-width: 1080px) {
1547-
.wrap.slimstat .postbox {
1541+
.wrap-slimstat .postbox {
15481542
width: 49.125%;
15491543
}
1550-
.wrap.slimstat .postbox.large,
1551-
.wrap.slimstat .postbox.extralarge,
1552-
.wrap.slimstat .postbox.full-width {
1544+
.wrap-slimstat .postbox.large,
1545+
.wrap-slimstat .postbox.extralarge,
1546+
.wrap-slimstat .postbox.full-width {
15531547
width: 99%;
15541548
}
15551549
}
@@ -1569,18 +1563,18 @@ body {
15691563
right: inherit;
15701564
top: inherit;
15711565
}
1572-
.wrap.slimstat .postbox,
1573-
.wrap.slimstat .postbox.large,
1574-
.wrap.slimstat .postbox.extralarge,
1575-
.wrap.slimstat .postbox.full-width {
1566+
.wrap-slimstat .postbox,
1567+
.wrap-slimstat .postbox.large,
1568+
.wrap-slimstat .postbox.extralarge,
1569+
.wrap-slimstat .postbox.full-width {
15761570
margin: 0 0 10px;
15771571
width: 99.5%;
15781572
}
1579-
.wrap.slimstat .postbox h3 {
1573+
.wrap-slimstat .postbox h3 {
15801574
font-size: 1.4em;
15811575
line-height: 1em;
15821576
}
1583-
.wrap.slimstat .postbox p {
1577+
.wrap-slimstat .postbox p {
15841578
// font-size: 1.1em;
15851579
line-height: 1.4em;
15861580
}
@@ -2970,8 +2964,8 @@ x:-o-prefocus {
29702964
}
29712965

29722966
// New Styles
2973-
.wrap.slimstat-config,
2974-
.wrap.slimstat {
2967+
.wrap-slimstat {
2968+
clear: both;
29752969
box-sizing: border-box;
29762970
overflow: hidden;
29772971

@@ -3579,7 +3573,7 @@ x:-o-prefocus {
35793573
}
35803574
}
35813575

3582-
.wrap.slimstat {
3576+
.wrap-slimstat {
35833577
table.widefat {
35843578
border: none;
35853579

admin/config/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@
10181018

10191019
?>
10201020
<div class="backdrop-container">
1021-
<div class="wrap slimstat-config">
1021+
<div class="wrap-slimstat slimstat-config">
10221022
<?php wp_slimstat_admin::get_template('header', ['is_pro' => wp_slimstat::pro_is_installed()]); ?>
10231023
<ul class="nav-tabs">
10241024
<?php echo $tabs_html ?>

admin/index.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,14 @@ public static function wp_slimstat_stylesheet($_hook = '')
827827

828828
// END: wp_slimstat_stylesheet
829829

830+
/**
831+
* Adds a shared body class to all Slimstat admin screens.
832+
*/
833+
public static function add_admin_body_class($classes)
834+
{
835+
return $classes . ' slimstat-admin-page';
836+
}
837+
830838
/**
831839
* Loads user-defined stylesheet code
832840
*/
@@ -1017,6 +1025,9 @@ public static function add_menus($_s = '')
10171025
add_action('load-' . $a_entry, [self::class, 'wp_slimstat_stylesheet']);
10181026
add_action('load-' . $a_entry, [self::class, 'wp_slimstat_enqueue_scripts']);
10191027
add_action('load-' . $a_entry, [self::class, 'contextual_help']);
1028+
add_action('load-' . $a_entry, function () {
1029+
add_filter('admin_body_class', [wp_slimstat_admin::class, 'add_admin_body_class']);
1030+
});
10201031
}
10211032

10221033
return $_s;

admin/view/addons.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
}
3636
?>
3737

38-
<div class="wrap slimstat">
38+
<div class="wrap-slimstat">
3939
<h2><?php _e('Add-ons', 'wp-slimstat') ?></h2>
4040
<p><?php _e('Add-ons extend the functionality of Slimstat in many interesting ways. We offer both free and premium (paid) extensions. Each add-on can be installed as a separate plugin, which will receive regular updates via the WordPress Plugins panel. In order to be notified when a new version of a premium add-on is available, please enter the <strong>license key</strong> you received when you purchased it.', 'wp-slimstat') ?><?php
4141
if (empty($_GET['force_refresh'])) {

admin/view/email-report.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// Load SlimStat Pro Modal
2222
wp_slimstat_admin::get_template('slimstat-pro-modal');
2323
?>
24-
<div class="wrap slimstat upgrade-pro email-report-locked">
24+
<div class="wrap-slimstat upgrade-pro email-report-locked">
2525
<img class="upgrade-pro-background" src="<?php echo esc_url(plugin_dir_url(__FILE__) . '../assets/images/email report.PNG'); ?>">
2626
</div>
2727
</div>
@@ -32,7 +32,7 @@
3232
wp_slimstat_admin::get_template('header', ['is_pro' => true]);
3333
?>
3434
<div class="backdrop-container">
35-
<div class="wrap slimstat slimstat-email-report">
35+
<div class="wrap-slimstat slimstat-email-report">
3636
<h2><?php _e('Email Report Configuration', 'wp-slimstat'); ?></h2>
3737

3838
<div class="slimstat-email-report-content">

admin/view/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
?>
88

99
<div class="backdrop-container">
10-
<div class="wrap slimstat">
10+
<div class="wrap-slimstat">
1111
<?php wp_slimstat_admin::get_template('header', ['is_pro' => wp_slimstat::pro_is_installed()]); ?>
1212

1313
<div class="notice slimstat-notice slimstat-tooltip-content" style="background-color:#ffa;border:0;padding:10px"><?php _e('<strong>AdBlock browser extension detected</strong> - If you see this notice, it means that your browser is not loading our stylesheet and/or Javascript files correctly. This could be caused by an overzealous ad blocker feature enabled in your browser (AdBlock Plus and friends). <a href="https://wp-slimstat.com/resources/the-reports-are-not-being-rendered-correctly-or-buttons-do-not-work" target="_blank">Please make sure to add an exception</a> to your configuration and allow the browser to load these assets.', 'wp-slimstat'); ?></div>

admin/view/layout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
?>
55

66
<div class="backdrop-container ">
7-
<div class="wrap slimstat slimstat-layout">
7+
<div class="wrap-slimstat slimstat-layout">
88
<?php wp_slimstat_admin::get_template('header', ['is_pro' => wp_slimstat::pro_is_installed()]); ?>
99

1010
<h1 class="wp-heading-inline"><?php _e('Customize', 'wp-slimstat'); ?></h1>

admin/view/upgrade-pro.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Load SlimStat Pro Modal
1010
wp_slimstat_admin::get_template('slimstat-pro-modal');
1111
?>
12-
<div class="wrap slimstat upgrade-pro">
12+
<div class="wrap-slimstat upgrade-pro">
1313
<?php wp_slimstat_admin::get_template('header', ['is_pro' => wp_slimstat::pro_is_installed()]); ?>
1414
<img class="upgrade-pro-background" src="<?php echo esc_url(plugin_dir_url(__FILE__) . '../assets/images/pro-blur.jpg'); ?>">
1515
</div>

0 commit comments

Comments
 (0)