Make WordPress Core

Opened 12 months ago

Closed 6 months ago

#64355 closed defect (bug) (fixed)

Plugin card width calculation and filter margin issues in install plugins screen

Reported by: abdalsalaam Owned by: westonruter
Priority: normal Milestone: 7.1
Component: Plugins Version: 5.3
Severity: normal Keywords: has-patch commit
Cc: Focuses: ui, administration

Description

The plugin installation screen has two CSS issues affecting layout:

  1. Plugin card width: At viewport widths between 1600px and 2299px, plugin cards use a redundant dual-width declaration (width: 30%; width: calc(33.1% - 8px);) that doesn't properly account for gap spacing in the 3-column layout.
  2. Filter margin: The .plugin-install-php .wp-filter rule sets margin-bottom: 0 causing unnecessary spacing issues.

Affected files:

  • wp-admin/css/list-tables.css
  • wp-admin/css/list-tables-rtl.css

Proposed solution:

  1. Replace the plugin card width calculation with calc((100% - 32px) / 3) which correctly distributes width accounting for total gap spacing (4 gaps × 8px = 32px)
  2. Remove the unnecessary .plugin-install-php .wp-filter margin rule

Steps to reproduce:

  1. Navigate to Plugins → Add New
  2. Resize browser window to 1600px-2299px width
  3. Observe plugin card spacing/alignment issues

Attachments (2)

Screenshot 2025-12-04 at 12.51.37 PM.png​ (219.9 KB ) - added by abdalsalaam 12 months ago.
522419951-a11dd468-b587-452b-8185-52b7c339cc97.png​ (257.7 KB ) - added by abdalsalaam 12 months ago.
After the fix

Download all attachments as: .zip

Change History (15)

This ticket was mentioned in ​PR #10596 on ​WordPress/wordpress-develop by ​@abdalsalaam.


12 months ago
#1

  • Keywords has-patch added

#2 follow-ups: @sabernhardt
12 months ago

  • Focuses administration added

Related: the .wp-filter (lack of) margin on the default 'Featured' tab is already reported on #64337.

#3 in reply to: ↑ 2 @abdalsalaam
12 months ago

Replying to sabernhardt:

Related: the .wp-filter (lack of) margin on the default 'Featured' tab is already reported on #64337.

Sorry I didn't see this, what about the card-width ?

#4 follow-up: @sabernhardt
12 months ago

The card width is an older issue, and I did not find an existing ticket about that. [29219] added the value, and I can see the slight discrepancy at least as early as WordPress 5.3.

If the width is worth adjusting, the clear should be obsolete too now that the container uses flex.

#5 @westonruter
12 months ago

  • Version → 5.3

#6 in reply to: ↑ 2 @westonruter
12 months ago

Replying to sabernhardt:

Related: the .wp-filter (lack of) margin on the default 'Featured' tab is already reported on #64337.

The line break has been restored between the filter links row and the plugin cards. See [61353]. Please re-test on trunk for the remaining issue for the plugin card width.

#7 in reply to: ↑ 4 @abdalsalaam
12 months ago

Replying to sabernhardt:

The card width is an older issue, and I did not find an existing ticket about that. [29219] added the value, and I can see the slight discrepancy at least as early as WordPress 5.3.

If the width is worth adjusting, the clear should be obsolete too now that the container uses flex.

You are right, I'd like to work on fixing these issues, will have a fix ready shortly

#8 @abdalsalaam
11 months ago

Update: I just pushed some changes to the PR, to remove some unnecessary CSS, @westonruter Could you please review the PR when you have a chance?

thank you

Last edited 11 months ago by abdalsalaam (previous) (diff)

This ticket was mentioned in ​Slack in #core-css by abdalsalaam. ​View the logs.


6 months ago

#11 @westonruter
6 months ago

  • Milestone Awaiting Review → 7.1

#12 @westonruter
6 months ago

  • Keywords commit added
  • Owner set to westonruter
  • Status new → reviewing

#13 @westonruter
6 months ago

  • Resolution → fixed
  • Status reviewing → closed

In 62446:

Plugins: Fix plugin card width calculation on the Add Plugins screen.

Replace the obsolete float-based layout with the flex container's gap, and remove the now-unnecessary float, clear, and :nth-child margin overrides. This eliminates the slight width discrepancy that left a gap on the right edge.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/10596.
Follow-up to r29047, r29219.

Props abdalsalaam, sabernhardt, westonruter.
See #28785.
Fixes #64355.

Note: See TracTickets for help on using tickets.