What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Issue with card heading underline width in Dawn theme 15.0.1

Issue with card heading underline width in Dawn theme 15.0.1

adkowaty
Excursionist
36 0 1

Hello,

 

I'm trying to style the card heading and I'm facing an issue with the underline width. I want the underline to match the exact width of the text. I'm currently using the Dawn theme (version 15.0.1).

 

Below is the CSS I'm using (which works perfectly for the most part):

.card__heading a {
font-size: 16px !important;
font-weight: 700 !important;
color: #000 !important;
text-decoration: none !important;
position: relative !important;
display: inline-block !important;
}
.card__heading a:hover {
color: #ff33fd !important;
}
.card__heading a::after {
content: '' !important;
position: absolute !important;
width: 0 !important;
height: 2px !important;
background-color: #ff33fd !important;
bottom: 0px !important;
top: 23px!important;
left: 0 !important;
transition: width 0.3s ease !important;
}
.card__heading a:hover::after {
width: 100% !important;
}
.card-information>* {
-webkit-line-clamp: 1 !important;
-webkit-box-orient: vertical !important;
display: -webkit-box !important;
overflow: hidden !important;
}

The problem arises when I add the following properties to .card__heading a:

-webkit-line-clamp: 1!important;
-webkit-box-orient: vertical!important;
display: -webkit-box!important;
overflow: hidden!important;
line-height: 25px!important;
transition: color 0.3s ease!important;

After adding these lines, I'm unable to make the underline match the length of the product title anymore.

 

Do you have any suggestions on how to resolve this issue?

 

Thank you in advance for your time and help.

Best regards,
Adrian

Replies 7 (7)
adkowaty
Excursionist
36 0 1

Hello Sangeetanahar,

 

You are a genius—thank you! The issue is mostly resolved, but I’ve encountered a strange problem. The fix is now working across all collections except for one on the home page.

 

If you could take a look, I’d be really grateful.
Website: www.vapelounge.uk
Password: vl

 

When you're on the site, you'll notice that the fix is applied to all .card_heading a { elements, except for the "Mix and Match Disposables" section. Do you have any idea why this might be happening?

Thanks so much for your time and help!

Best regards,
Adrian

adkowaty
Excursionist
36 0 1

Noticed one problem more just now because of my code collection list is not clickable. 😕

 

ScreenShot Tool -20241002054743.png

adkowaty
Excursionist
36 0 1

I just noticed that the underline is longer than the product title, not only in the "Mix and Match Disposables" collection but also in the CBD and New Arrivals collections. It's strange because the underline is not working correctly on the Disposables and CBD collection pages, while it works fine on the other collection pages.

 

I'm not sure what's going on or why it works for some collections and not for others. Do you have any suggestions, please?

websensepro
Shopify Partner
1289 145 166

Hi @adkowaty , kindly provide your store URL please. Thanks

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here

Free Shopify Beginner Tutorial
adkowaty
Excursionist
36 0 1

Hi,

 

Sure, www.vapelounge.uk.

 

Thanks for your time and help in advance,

Regards,

Adrian

Dan-From-Ryviu
Shopify Partner
10283 2042 2112

Hi @adkowaty 

You can try to update your code to this and check again 

      .card__heading { display: block; width: fit-content; }
      .card__heading a {
      font-size: 16px !important;
      font-weight: 700 !important;
      color: #000 !important;
      text-decoration: none !important;
      position: relative !important;
      display: inline-block !important;
      }
      .card__heading a:hover {
      color: #ff33fd !important;
      }
      .card__heading a:after {
      content: '' !important;
      position: absolute !important;
      width: 0 !important;
      height: 2px !important;
      background-color: #ff33fd !important;
      bottom: 0px !important;
      top: 23px!important;
      left: 0 !important;
      transition: width 0.3s ease !important;
      }
      .card__heading a:hover::after {
      width: 100% !important;
      }
      .card-information>* {
      -webkit-line-clamp: 1 !important;
      -webkit-box-orient: vertical !important;
      display: -webkit-box !important;
      overflow: hidden !important;
      }

- Helpful? Like and Accept solution! Or Support me: Buy Coffees
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

adkowaty
Excursionist
36 0 1

Hi Dan-From-Ryviu,

 

Thank you for the CSS, but unfortunately, it doesn't work. 😕

 

Regards,

Adrian

 

Regards,

Adrian