From 3da647c246acb9e3e3eb6819ecdaa5c5d68096df Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Mon, 24 Jul 2023 16:14:44 +0530 Subject: [PATCH] bootstrap: Remove unnecessary CSS for th and td elements. The html for tables used by us has a following structure-
So, as per the above structure, we do not have th elements inside tbody and td elements inside thead and thus we can remove the bootstrap CSS rules for these cases. Also, we always have a thead before tbody, so tbody:first-child CSS can also be removed. --- web/third/bootstrap/css/bootstrap.css | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/web/third/bootstrap/css/bootstrap.css b/web/third/bootstrap/css/bootstrap.css index 49bdae6510..cfd0d55cff 100644 --- a/web/third/bootstrap/css/bootstrap.css +++ b/web/third/bootstrap/css/bootstrap.css @@ -239,8 +239,7 @@ table { .table thead th { vertical-align: bottom; } -.table thead:first-child tr:first-child th, -.table thead:first-child tr:first-child td { +.table thead:first-child tr:first-child th { border-top: 0; } .table tbody + tbody { @@ -265,41 +264,30 @@ table { .table-bordered td { border-left: 1px solid #dddddd; } -.table-bordered thead:first-child tr:first-child th, -.table-bordered tbody:first-child tr:first-child th, -.table-bordered tbody:first-child tr:first-child td { +.table-bordered thead:first-child tr:first-child th { border-top: 0; } -.table-bordered thead:first-child tr:first-child > th:first-child, -.table-bordered tbody:first-child tr:first-child > td:first-child, -.table-bordered tbody:first-child tr:first-child > th:first-child { +.table-bordered thead:first-child tr:first-child > th:first-child { -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } -.table-bordered thead:first-child tr:first-child > th:last-child, -.table-bordered tbody:first-child tr:first-child > td:last-child, -.table-bordered tbody:first-child tr:first-child > th:last-child { +.table-bordered thead:first-child tr:first-child > th:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; } -.table-bordered thead:last-child tr:last-child > th:first-child, -.table-bordered tbody:last-child tr:last-child > td:first-child, -.table-bordered tbody:last-child tr:last-child > th:first-child { +.table-bordered tbody:last-child tr:last-child > td:first-child { -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } -.table-bordered thead:last-child tr:last-child > th:last-child, -.table-bordered tbody:last-child tr:last-child > td:last-child, -.table-bordered tbody:last-child tr:last-child > th:last-child { +.table-bordered tbody:last-child tr:last-child > td:last-child { -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } -.table-striped tbody > tr:nth-child(odd) > td, -.table-striped tbody > tr:nth-child(odd) > th { +.table-striped tbody > tr:nth-child(odd) > td { background-color: #f9f9f9; } .table tbody tr.success > td {