gb-photo Posted June 21, 2021 Share Posted June 21, 2021 Site URL: https://www.garethbevan.com I have added a whatsapp icon to my header and menu, it displays fine in light themes where the background is white and the icon is black. I have created the same logo in white for dark backgrounds. Can anyone help me out with the custom css to switch the logo color based on the dark/light theme. Thanks! Link to comment
tuanphan Posted June 22, 2021 Share Posted June 22, 2021 Hi. It looks like you solved this? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
unavolta Posted March 29, 2022 Share Posted March 29, 2022 @tuanphan Also looking to do this for adding a Substack logo the social icons. I have been able to add it in in one color but I want it to shift from white to blue based on light or dark setting. & in mobile popup menu dark theme: https://www.melinahammer.com/ light theme: https://www.melinahammer.com/book pw: melina Want it as-is (White) here: Want it to be blue here: Link to comment
tuanphan Posted April 1, 2022 Share Posted April 1, 2022 On 3/30/2022 at 2:07 AM, unavolta said: @tuanphan Also looking to do this for adding a Substack logo the social icons. I have been able to add it in in one color but I want it to shift from white to blue based on light or dark setting. & in mobile popup menu dark theme: https://www.melinahammer.com/ light theme: https://www.melinahammer.com/book pw: melina Want it as-is (White) here: Want it to be blue here: #1. To change it to black on Book Page Header add this code into Book Page header <style> .header-actions-action a[href*="substack"] { filter: invert(1); -webkit-filter: invert(1); } </style> #2. To add substack on Mobile Menu Overlay, add this to Design > Custom CSS header#header a.icon[href*="substack"] svg { display: none; } header#header a.icon[href*="substack"] { background-image: url(https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/623ba7cba0a6a72aa3882777/1648076747954/substack2.png); background-size: 100%; background-repeat: no-repeat; } body.header--menu-open header#header a.icon[href*="substack"] { filter: invert(1); -webkit-filter: invert(1); } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
unavolta Posted April 1, 2022 Share Posted April 1, 2022 10 hours ago, tuanphan said: #1. To change it to black on Book Page Header add this code into Book Page header <style> .header-actions-action a[href*="substack"] { filter: invert(1); -webkit-filter: invert(1); } </style> #2. To add substack on Mobile Menu Overlay, add this to Design > Custom CSS header#header a.icon[href*="substack"] svg { display: none; } header#header a.icon[href*="substack"] { background-image: url(https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/623ba7cba0a6a72aa3882777/1648076747954/substack2.png); background-size: 100%; background-repeat: no-repeat; } body.header--menu-open header#header a.icon[href*="substack"] { filter: invert(1); -webkit-filter: invert(1); } @tuanphanThanks! Close - Part 1) I got it to work to #15284C on the mobile menu by removing the body.header section and changing the URL to a new .PNG of the #15284C file Code: //substack color on mobile menu only// @media screen and (max-width:767px) { header#header a.icon[href*="substack"] svg { display: none; } header#header a.icon[href*="substack"] { background-image: url(https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/6240b25db51f1159dbbe011b/1648407133383/substack2_blue.png); background-size: 100%; background-repeat: no-repeat; }} Part 2) but in the header on light mode on certain pages like Book I want it to be the color #15284C, not black. I tried adjusting a few filters but can't get the right color or change the direct URL of the icon like for the mobile menu. #15284C URL: https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/6240b25db51f1159dbbe011b/1648407133383/substack2_blue.png Link to comment
unavolta Posted April 12, 2022 Share Posted April 12, 2022 On 4/1/2022 at 10:53 AM, unavolta said: @tuanphanThanks! Close - Part 1) I got it to work to #15284C on the mobile menu by removing the body.header section and changing the URL to a new .PNG of the #15284C file Code: //substack color on mobile menu only// @media screen and (max-width:767px) { header#header a.icon[href*="substack"] svg { display: none; } header#header a.icon[href*="substack"] { background-image: url(https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/6240b25db51f1159dbbe011b/1648407133383/substack2_blue.png); background-size: 100%; background-repeat: no-repeat; }} Part 2) but in the header on light mode on certain pages like Book I want it to be the color #15284C, not black. I tried adjusting a few filters but can't get the right color or change the direct URL of the icon like for the mobile menu. #15284C URL: https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/6240b25db51f1159dbbe011b/1648407133383/substack2_blue.png @tuanphanI figured it out 🙂 and got it to work in header on the specific pages I wanted with this code in the page header code injection: <style> .header-actions-action a[href*="substack"] { background-image: url(https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/6240b25db51f1159dbbe011b/1648407133383/substack2_blue.png); } </style> and on the social icon list in a specific block with this code in custom CSS: div #block-bf044cab69af258d3349 { .sqs-svg-icon--list a:nth-of-type(3){ background-image: url(https://static1.squarespace.com/static/61e7443d8270c01ce2239916/t/6240b25db51f1159dbbe011b/1648407133383/substack2_blue.png); } } tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment