- AuthorPosts
- November 18, 2020 at 3:14 pm #31548WendyGuest
Hi again. Please can you tell me the classes and syntax to change the background colour of the masthead in the Hydra theme? If it needs to be one of the 3 principal colours selected for the theme, I would rather it were the third (dark grey) than the first (white) if that helps at all?
November 18, 2020 at 3:32 pm #31565Jesse OwensKeymasterHi Wendy-
It doesn’t have to be one of the palette colors, you can choose. Hydra’s a little tricky because it uses JavaScript to change the background as your visitor scrolls down the page, so you’ll probably want two rules for this.
For the background before you scroll down, use this rule:
.palette-primary .site-header { background-color: rgba( 62,62,62,0.8 ) !important; }
The rule above is using the default color palette’s third color of #3e3e3e converted into RGBA so that the transparency of the original design is preserved.
For the background after you scroll down, use this rule:
header.smaller { background-color: #3e3e3e !important; }
November 19, 2020 at 1:54 pm #31579WendyGuestGreat! That works perfectly! Thanks! Except … I will now need to change all the default text, link and background colours for the menus and masthead text as they no longer show up … Sorry! Should have asked that in the same breath!
November 19, 2020 at 2:01 pm #31600Jesse OwensKeymasterHi Wendy-
You’re right, I should have noticed that but I had already modified my header text in my testing site! Use code like this:
.palette-primary .site-header a, .palette-primary .site-header a .fa, .palette-primary .site-header .site-description { color: purple !important; }
Simply change purple to your desired color in Hex or RGB value.
Edit: Updated this code to work for your site’s tagline, if you’re using it.- This reply was modified 4 years, 1 month ago by Jesse Owens. Reason: fix code
- AuthorPosts
- The topic ‘Hydra: Change masthead section background colour’ is closed to new replies.