jordansears2 Posted October 12 Posted October 12 Site URL: https://www.brightpt.com/ Hey, thank you for taking the time to look - I'm trying to figure out how to get the header logo and navigation links to turn from white on a transparent background, to color on a white background after scroll. I've got the fixed nav set up with the correct colors once you scroll past the top image but need the logo / nav items to be white when on the transparent background. I have been trying to do it using filter: invert but I'm not able to get that code to apply only to the navigation when it's in it's original position. Thank you!
Solution Square_Ace Posted October 12 Solution Posted October 12 (edited) Hi, try adding this code in your code injection header: <style> #header[data-section-theme="bright-inverse"]:not(.shrink) { --navigationLinkColor: #fff; } </style> This will work when the first section colour palette is what you have your homepage set to (I think it's Bright 1, might be Bright 2). It can't go in the Custom CSS because it doesn't like CSS variables with capitals, but that's how Squarespace sets it. If you want to animate the transition, this will work just for the nav links and can be added to the Custom CSS. You'll need to modify it if you want it to work for more than the nav links or if you add a site-wide Squarespace animation: .header-nav-item a { transition: color 0.4s; } Your logo will still be black. This could be fixed if you used an SVG for the logo because you can control the colour of SVGs with CSS. You'd need some javascript to replace the logo <img> with an <svg> element. Hope that helps. Andrew Square Ace Edited October 12 by digitalfreelancer Enhancing Squarespace websites for over a decade. I am an expert in writing custom code for the Squarespace platform. Tailor-made, reusable solutions to your problems, whether it's styling, layout or functionality. Maverick Squarespace Designers, I'll be your Goose. If your tools are holding back your creative vision, maybe I can help. I also build useful plugins for Squarespace (with some really positive reviews) including the popular high-quality video background plugin.
jordansears2 Posted October 13 Author Posted October 13 (edited) Thank you! That worked perfectly. Thank you! That is very close, but my dropdown nav links ( titled either #header a[href="/#secondary-nav" or #wm-subnav a.wm-subnav-item in the CSS ) are also white now on a white background. Is there a way to control those separately? Thank you very much for your time, this is much closer than I've gotten after quite a bit of CSS trial / error. EDIT: I solved the above in italics by adding CSS to .header-nav-folder-item-content Edited October 13 by jordansears2 fixed problem Square_Ace 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment