Skip to content

fix(css): admin page body class and CSS config fixes#175

Merged
parhumm merged 4 commits intodevelopmentfrom
fix/css-config-page
Mar 12, 2026
Merged

fix(css): admin page body class and CSS config fixes#175
parhumm merged 4 commits intodevelopmentfrom
fix/css-config-page

Conversation

@parhumm
Copy link
Copy Markdown
Contributor

@parhumm parhumm commented Mar 12, 2026

Summary

  • Replace .wrap.slimstat with .wrap-slimstat to avoid WordPress core style conflicts
  • Add slimstat-admin-page body class to all Slimstat admin screens via admin_body_class filter
  • Recompile admin.scss to admin.css

Test plan

  • Open any Slimstat admin page → inspect <body> → should contain slimstat-admin-page
  • Open a non-Slimstat admin page → should NOT contain the class
  • Verify Slimstat admin styles render correctly without WP core .wrap interference

Summary by CodeRabbit

  • Refactor

    • Reorganized internal CSS class naming conventions across admin pages for improved consistency
    • Updated admin styling structure and selectors to align with modern naming practices
  • Style

    • Enhanced styling implementation across admin interface for better maintainability and code clarity

parhumm added 4 commits March 12, 2026 07:14
…e conflicts

Rename the two-class selector .wrap.slimstat to a single .wrap-slimstat
class across all admin views and SCSS to prevent WordPress core .wrap
styles from interfering with SlimStat config page layout.
Register admin_body_class filter via load-{hook} actions so the class
is only appended on Slimstat pages, with zero overhead on other screens.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 12, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request refactors the CSS class naming convention from separate "wrap slimstat" classes to a unified "wrap-slimstat" hyphenated class across all admin pages and stylesheets. It also introduces a new public method to register admin body class filtering for SlimStat admin pages.

Changes

Cohort / File(s) Summary
CSS Stylesheet Updates
admin/assets/scss/admin.scss
Replaces global namespace selector from ".wrap.slimstat" to ".wrap-slimstat", updates all child selectors, adds new .wrap-slimstat { clear: both; } rule, updates admin-page visibility logic to use ".slimstat-admin-page", and adjusts RTL/LTR dependent rules for consistent alignment.
Admin View Container Class Updates
admin/view/addons.php, admin/view/email-report.php, admin/view/index.php, admin/view/layout.php, admin/view/upgrade-pro.php, admin/config/index.php, src/view/migration-page.php
Updates HTML wrapper container classes from "wrap slimstat" (or variations) to "wrap-slimstat" across all admin pages, affecting DOM structure and CSS targeting without altering logic.
Admin Page Hook Registration
admin/index.php
Introduces new public static method add_admin_body_class($classes) that appends "slimstat-admin-page" class to admin body classes and registers the method with the admin_body_class filter hook.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hyphens hop where spaces were before,
Classes unified, cleaner than before!
From .wrap.slimstat to .wrap-slimstat's cheer,
Admin pages gleam with their new CSS veneer.
One method added, filters complete,
This stylesheet refactor makes the codebase neat! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: a CSS namespace fix (replacing .wrap.slimstat with .wrap-slimstat) and the addition of admin page body class handling, which are the core objectives of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/css-config-page

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@parhumm parhumm merged commit ffa53eb into development Mar 12, 2026
1 check was pending
@parhumm parhumm deleted the fix/css-config-page branch March 12, 2026 07:33
parhumm added a commit that referenced this pull request Mar 14, 2026
…218 fix

- Added PR #218: Fix 500 errors on REST/admin-ajax tracking endpoints
- Added PR links for consent fixes (#172, #178), CSS (#175), email layout (#177),
  GeoIP timestamp (#185), admin performance (#189), visitor counting (#178)
@parhumm parhumm mentioned this pull request Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant