Make WordPress Core

Changeset 62446


Ignore:
Timestamp:
06/02/2026 11:09:38 AM (8 weeks ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r62400 r62446  
    14751475        display: flex;
    14761476        flex-wrap: wrap;
     1477        gap: 16px;
    14771478}
    14781479
     
    15061507
    15071508.plugin-card {
    1508         float: left;
    1509         margin: 0 8px 16px;
    1510         width: 48.5%;
    15111509        width: calc( 50% - 8px );
    15121510        background-color: #ffffff;
     
    15171515}
    15181516
    1519 .plugin-card:nth-child(odd) {
    1520         clear: both;
    1521         margin-left: 0;
    1522 }
    1523 
    1524 .plugin-card:nth-child(even) {
    1525         margin-right: 0;
    1526 }
    1527 
    1528 @media screen and (min-width: 1600px) and ( max-width: 2299px ) {
     1517@media screen and (min-width: 1600px) {
    15291518        .plugin-card {
    1530                 width: 30%;
    1531                 width: calc( 33.1% - 8px );
    1532         }
    1533 
    1534         .plugin-card:nth-child(odd) {
    1535                 clear: none;
    1536                 margin-left: 8px;
    1537         }
    1538 
    1539         .plugin-card:nth-child(even) {
    1540                 margin-right: 8px;
    1541         }
    1542 
    1543         .plugin-card:nth-child(3n+1) {
    1544                 clear: both;
    1545                 margin-left: 0;
    1546         }
    1547 
    1548         .plugin-card:nth-child(3n) {
    1549                 margin-right: 0;
     1519                width: calc( (100% - 32px) / 3 );
    15501520        }
    15511521}
     
    15531523@media screen and (min-width: 2300px) {
    15541524        .plugin-card {
    1555                 width: 25%;
    1556                 width: calc( 25% - 12px );
    1557         }
    1558 
    1559         .plugin-card:nth-child(odd) {
    1560                 clear: none;
    1561                 margin-left: 8px;
    1562         }
    1563 
    1564         .plugin-card:nth-child(even) {
    1565                 margin-right: 8px;
    1566         }
    1567 
    1568         .plugin-card:nth-child(4n+1) {
    1569                 clear: both;
    1570                 margin-left: 0;
    1571         }
    1572 
    1573         .plugin-card:nth-child(4n) {
    1574                 margin-right: 0;
     1525                width: calc( (100% - 48px) / 4 );
    15751526        }
    15761527}
Note: See TracChangeset for help on using the changeset viewer.