Skip to content

Commit

Permalink
add .has-content if count > 0 on load
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed May 2, 2023
1 parent fe02af8 commit e072afa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ function nav() {
shop.textContent = 'Shop';

search.classList.add('nav-icon', 'nav-search');
favorites.classList.add('nav-icon', 'nav-favorites');
favorites.classList.add('nav-icon', 'nav-favorites', favAmount && 'has-content');
favoritesCount.classList.add('nav-favorites-count');
favoritesCount.textContent = favAmount;
cart.classList.add('nav-icon', 'nav-cart');
cart.classList.add('nav-icon', 'nav-cart', cartAmount && 'has-content');
cartCount.classList.add('nav-cart-count');
cartCount.textContent = cartAmount;
user.classList.add('nav-icon', 'nav-user');
Expand Down

0 comments on commit e072afa

Please sign in to comment.