Skip to content

Commit

Permalink
fix: CSS not applied to product title (backport #35582) (#35635)
Browse files Browse the repository at this point in the history
In an erpnext website, the /all-products route shows website items that have been published to the web site.

In the list view (erpnext/e_commerce/product_ui/list.js), the css class is null for the product title. Instead, inline style statements have been added in that can not be modified by overriding CSS.

This fix uses a similar approach to that which is taken in the grid view (erpnext/e_commerce/product_ui/grid.js). It removes the null CSS parameter in the product title link as well as the inline style statement. Then, as in the grid view, the product title is wrapped in a div tag with the product_title CSS class.

This makes it possible to style the product title as desired with a CSS override.
  • Loading branch information
trustedcomputer authored Jun 12, 2023
1 parent 97f4af8 commit 1b69b37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions erpnext/e_commerce/product_ui/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ erpnext.ProductList = class {
let title_html = `<div style="display: flex; margin-left: -15px;">`;
title_html += `
<div class="col-8" style="margin-right: -15px;">
<a class="" href="/${ item.route || '#' }"
style="color: var(--gray-800); font-weight: 500;">
<a href="/${ item.route || '#' }">
<div class="product-title">
${ title }
</div>
</a>
</div>
`;
Expand Down Expand Up @@ -201,4 +202,4 @@ erpnext.ProductList = class {
}
}

};
};

0 comments on commit 1b69b37

Please sign in to comment.