Guest Posted July 23, 2020 Share Posted July 23, 2020 wellworndenim.squarespace.com pass: wellworndenim Heya, I'm pretty stuck here. This is a part of development that I've not learnt to deal with well. Apologies if I over explained below, I just wanted to be clear. I wanted to replace a generic link icon in the main nav with the Etsy logo. I found a way to do this, but there's an issue. I use the following code: @media only screen and (min-width:800px) { .icon--fill:nth-of-type(1) { svg { display:none; } background-image: url(https://static1.squarespace.com/static/5ed9495a8b705f28b7e9ba1a/t/5f158f068f488a75b54f8328/1595248390506/etsy4.png); background-size: 100%; background-repeat: no-repeat; } } .header-menu-actions-action:nth-of-type(1) { svg { display:none; } background-image: url(https://static1.squarespace.com/static/5ed9495a8b705f28b7e9ba1a/t/5f158f068f488a75b54f8328/1595248390506/etsy4.png); background-size: 100%; background-repeat: no-repeat; } It replaces the generic icon with my uploaded Etsy icon on both mobile and desktop. However, the cut-off the with media query is causing issues on my iPad pro in portrait mode. If you go to the site, you'll see in the nav bar there are two links designated by icons. Etsy and Instagram. As the Etsy logo wasn't supported by Squarespace's social links and just produced a generic Link icon, I had to place a custom solution. The code above targets just the generic link icon, and it requires two different blocks of code: one for desktop, one for mobile. The code tells the site to load the custom icon, but if the width is above 800px it should load the desktop version. If the mobile menu appears above the min-width of the media query, it uses the desktop code which is not compatible and BOTH links are replaced with the custom Etsy Icon. Due to the iPad's pixel density in portrait mode being way above 800px, and the fact it uses the mobile menu in that mode, it loads the desktop version while it's showing the mobile menu and shows two Etsy logos. I can't bring the media query up to the size of the iPad's screen's portrait mode, as that would break the desktop link on smaller laptop screens or if the window were resized. Is there a solution for this where I can specifically target the mobile menu itself, whenever it appears? Or some cleaner way of doing this? Any help would be very much appreciated! Link to comment
popofglitter Posted October 30, 2020 Share Posted October 30, 2020 Also hoping for a resolution to this.. Link to comment
tuanphan Posted October 31, 2020 Share Posted October 31, 2020 10 hours ago, ChloeManson said: Also hoping for a resolution to this.. If you share link to page where you used icons. We can help easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.