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
37 0 2

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
37 0 2

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
37 0 2

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

 

ScreenShot Tool -20241002054743.png

adkowaty
Excursionist
37 0 2

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
1869 220 266

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

Need a Shopify developer? Hire us at WebSensePro For Shopify Design Changes/Coding
For Free Tutorials Subscribe to our youtube
Get More Sales Using Big Bulk Discount APP
Create Your Shopify Store For Just 1$/Month
Get More Sales Using Big Bulk Discount APP
adkowaty
Excursionist
37 0 2

Hi,

 

Sure, www.vapelounge.uk.

 

Thanks for your time and help in advance,

Regards,

Adrian

Dan-From-Ryviu
Shopify Partner
11345 2223 2392

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

- Found this helpful? Hit "Like" and "Accept as Solution"! - Feeling generous. Buy me coffee!
- 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 - Gain customers with photo gallery, video & shoppable image
Built for Shopify

Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

adkowaty
Excursionist
37 0 2

Hi Dan-From-Ryviu,

 

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

 

Regards,

Adrian

 

Regards,

Adrian