Skip to content

Commit 026d3e2

Browse files
committed
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 WordPress#10596. Follow-up to r29047, r29219. Props abdalsalaam, sabernhardt, westonruter. See #28785. Fixes #64355. git-svn-id: https://develop.svn.wordpress.org/trunk@62446 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3308c65 commit 026d3e2

1 file changed

Lines changed: 4 additions & 53 deletions

File tree

src/wp-admin/css/list-tables.css

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,7 @@ ul.cat-checklist input[name="post_category[]"]:indeterminate::before {
14741474
.plugin-install-php #the-list {
14751475
display: flex;
14761476
flex-wrap: wrap;
1477+
gap: 16px;
14771478
}
14781479

14791480
.plugin-install-php .plugin-card {
@@ -1505,9 +1506,6 @@ ul.cat-checklist input[name="post_category[]"]:indeterminate::before {
15051506
}
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;
15131511
border: 1px solid rgb(0, 0, 0, 0.1);
@@ -1516,62 +1514,15 @@ ul.cat-checklist input[name="post_category[]"]:indeterminate::before {
15161514
overflow: hidden;
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
}
15521522

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
}
15771528

0 commit comments

Comments
 (0)