morgantaylr Posted February 29 Share Posted February 29 (edited) The logo .png I uploaded to my site is originally white. I know these can't be "adaptive" since it's an image, but I was hoping I could implement a code that can invert it automatically when the first sections color theme is selected (similar to how adaptive text works). I'm trying to refrain from using any kind of block, section, or collection ID to do this. I have tried this: [data-theme-color="var(--lightest)"] .header-title-logo img, [data-theme-color="var(--light)"] .header-title-logo img { filter: invert(100%); } I've also tried code injection and html but nothing. Hopefully Squarespace can make this more flexible in the future! On another note, when I do use the section ID, how can I get it to only invert on the desktop and mobile, but not in mobile nav? https://sandbar-demo.squarespace.com/ password: demo Thank you! Edited February 29 by morgantaylr wrong link Link to comment
tuanphan Posted March 2 Share Posted March 2 #1. I see you figured it out? #2. Suppose your code is #header .header-mobile-logo img, #header .header-title-logo img { content: var(--dark-logo); } to apply desktop, use this code <style> @media screen and (min-width:992px) { #header .header-mobile-logo img, #header .header-title-logo img { content: var(--dark-logo); } } </style> to apply mobile, use this CSS <style> @media screen and (max-width:991px) { #header .header-mobile-logo img, #header .header-title-logo img { content: var(--dark-logo); } } </style> 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
Create an account or sign in to comment
You need to be a member in order to leave a comment