fix(ui): responsive "Our Plugins" flexbox layout#1022
fix(ui): responsive "Our Plugins" flexbox layout#1022faisalahammad wants to merge 2 commits intowp-media:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Settings page “Our Plugins” section to use a flexbox-based card grid so plugin cards wrap cleanly on smaller viewports (fixing the overlap/overflow reported in #1009).
Changes:
- Added a dedicated wrapper container (
.imagify-plugin-family-cards) around the plugin-family loop in the settings template. - Replaced the float-based 4-column layout with a wrapping flexbox grid and added responsive breakpoints (4 → 2 → 1 columns).
- Adjusted card/logo/body/footer styles to behave better in a flex column layout (e.g., consistent footer placement, responsive logos).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
views/page-settings.php |
Wrapes the plugin-family cards in a new flex container element. |
assets/css/admin.css |
Implements the flexbox grid + responsive breakpoints and updates card/logo/body/footer styles to prevent overlap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .imagify-plugin-family-cards { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| margin: 0 -10px; | ||
| } | ||
| .imagify-plugin-family-col { | ||
| width: 25%; | ||
| box-sizing: border-box; | ||
| padding: 0 10px; |
There was a problem hiding this comment.
Imagify_Assets::register_style() serves .min.css when not in debug mode, so updating only admin.css means the responsive layout fix won’t be shipped to most installs. Regenerate/commit assets/css/admin.min.css (and any other derived CSS artifacts) so production loads the updated rules.
|
Thanks for the review! Regenerated |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Summary
Updates the "Our Plugins" section layout on the settings page to use Flexbox rather than obsolete floats, fixing unresponsive overlapping cards on smaller screens.
Fixes #1009
Problem
On smaller screens (e.g. tablet width), the plugins section cards overlap each other horizontally instead of neatly wrapping to new rows, making the text unreadable and the logos break container bounds. The original float-based CSS (
float: left; width: 25%;) did not properly trigger responsive clearing.Solution
Wrapped the PHP loop for the plugins with a new semantic container (
.imagify-plugin-family-cards) and migrated the columns to use strict CSS Flexbox sizing (flex: 0 0 25%) with logical breakpoint shifts to 50% width and 100% width. Tested across devices.Changes
views/page-settings.phpBefore:
After:
Why this works:
Flexbox requires a parent flex container to dictate layout rules to children (
flex-wrap: wrap). This new wrapper isolates the layout from the other text elements on the page.assets/css/admin.cssBefore:
After:
Why this works:
Using flex column ensures inner child margins and heights operate elegantly. Additional
@mediabreakpoints at1200pxand600pxallow thewidthto elegantly pop from 4 items, to 2 items, and then 1 item per row.Testing
Manual Testing
Scenario 1: Standard Desktop screens (> 1200px)
Scenario 2: Tablet/Small screens (< 1200px)
Scenario 3: Mobile (< 600px)
Screen recording
imagify-our-plugins-section-responsive-test.mp4