Jump to content

How to add a unique style to header's second button?

Go to solution Solved by creedon,

Recommended Posts

Hello!

My website needs two buttons in the header, one styled as per the site's standard CTA button styling, and another styled differently.

To get the two buttons in the header, I followed @creedon's solution that worked well: https://github.com/tomsWebConsulting/twcsl/tree/main/v7.1/Add Buttons to Header#add-buttons-to-header

Now, I need to style the new button differently than the standard CTA button. I'm having trouble figuring out the best way to modify the javascript such that it assigns a new class to the second button. Ideally I'd like to use the site's tertiary button styling for this second button.

I am on Squarespace 7.1.

Any ideas?

Edited by OSTS
clarifying question and adding squarespace version #
Link to comment
  • Solution

You may be able to do this with pure CSS.

Please post the URL for a page on your site where we can see your issue.

A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 7/31/2023 at 10:15 AM, OSTS said:

I'm having trouble figuring out the best way to modify the javascript such that it assigns a new class to the second button. Ideally I'd like to use the site's tertiary button styling for this second button.

I adjusted the code so you can add a secondary or tertiary button.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

@creedon It sort of worked, but not entirely. I implemented the v.8 code. While the second button does now take on the tertiary styling, it seems the code has broken the font that's used in the header. It now presents as a fall-back font, and not the site font (Poppins, in this case). Any ideas why that might be?

EDIT: Having a look at Twitter, it looks like the custom font issue is being experienced by other users. Perhaps this is a Squarespace issue.

Edited by OSTS
Updated with Twitter findings.
Link to comment
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.