Minimal theme: How to limit product title to 2 lines?

I tried to limit the characters by using truncate, (found the code here in forum) it works fine but I need to keep the title at same level, it works on desktop but doesn’t work on mobile.
So its better to limit the product title to 2 lines, not limiting the characters.

I tried the codes in this topic, it didn’t work.
I use minimal theme.
My store link: https://wiggleduck.com/

Hi @thevista888 ,

As I can see your title is lengthy so if you try for decrease the font size then it will not visible at mobile.

Right solution is keep one product in one row for mobile version. so that title will be in 2 lines.

Like this

@thevista888 , do this to fix it in 20 seconds:

  1. In your Shopify Admin go to: online store > themes > actions > edit code
  2. Find Asset > theme.scss.liquid or theme.css and paste this at the bottom of the file:
p.grid-link__title {
      display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

Kind regards,
Diego

@oscprofessional

How did you do it? I don’t see any differences between the original file. Sorry if I’m missing.

@diego_ezfy Thanks for your precious help. Problem solved.

Hi Diego! I tried your code in my store but it didn’t change anything…