DerrickSaenz Posted June 9, 2023 Posted June 9, 2023 Site password: colorcodehelp There are variables in for the colors that are changed throughout the code whenever you change the color palette. I want to use those so I can stop having to copy and paste the hex codes or the hsl numbers every time I want to add something within the color palette. Is there a way for me to start using those variables? For example I found this code: <style id="colorThemeStyles"> :root { --white-hsl: 41.54, 23.64%, 89.22%; --black-hsl: 60, 3.45%, 17.06%; --safeLightAccent-hsl: 176.9, 28.16%, 59.61%; --safeDarkAccent-hsl: 60, 3.45%, 17.06%; --safeInverseAccent-hsl: 60, 3.45%, 17.06%; --safeInverseLightAccent-hsl: 60, 3.45%, 17.06%; --safeInverseDarkAccent-hsl: 41.54, 23.64%, 89.22%; --accent-hsl: 176.9, 28.16%, 59.61%; --lightAccent-hsl: 44.27, 74.1%, 72.75%; --darkAccent-hsl: 211.46, 49.76%, 40.59%; } .white { --announcement-bar-background-color: hsla(var(--black-hsl), 1); --announcement-bar-text-color: hsla(var(--white-hsl), 1); --backgroundOverlayColor: hsla(var(--white-hsl), 1); ... and so on I see the colors there in that root tag, and I want to use it elsewhere, like in shadows or the effect on my site whenever you hover over a blog post link. I am still experimenting with color, so I want to figure out how to change all the effects at the same time rather than going into the color panel and then to the CSS code panel. Thank you!
Solution paul2009 Posted June 9, 2023 Solution Posted June 9, 2023 You should be able to refer to them as variables in the Custom CSS panel. For example to set the colour of an element to match the navigation link colour, you'd use: color: var(--navigationLinkColor); Each item in the styles panel has a value. For example, the background colour of primary buttons and secondary buttons are: var(--primaryButtonBackgroundColor); var(--secondaryButtonBackgroundColor); I hope that helps. Did this help? Please give feedback by clicking an icon below ⬇️ KimmyBartle 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
DerrickSaenz Posted June 9, 2023 Author Posted June 9, 2023 (edited) this isn't the IDEAL solution, I'd much rather use the variables themselves, but I also am not making a restaurant, so I was able to map the menu block colors to the five different palette colors. Thank you! Example: WHITE: var(--tweak-menu-block-nav-color) LIGHT ACCENT: var(--tweak-menu-block-title-color) ACCENT: var(--tweak-menu-block-item-title-color) DARK ACCENT: var(--tweak-menu-block-item-description-color) BLACK: var(--tweak-menu-block-item-price-color) in practice: .header-title-logo img, .header-mobile-logo img { filter: invert(1) drop-shadow(0px 0px var(--tweak-menu-block-item-title-color)) drop-shadow(0px 0px var(--tweak-menu-block-title-color)); transition: all 0.25s ease-in-out !important; } Edited June 9, 2023 by DerrickSaenz
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment