Jump to content

How do I replace Squarespace's buttons with my own custom css buttons?

Recommended Posts

I'm trying to replace the default buttons on my template (Sonny) with some custom CSS buttons I have made. I know I can insert them using a code block, but ideally I'd like to be able to insert them using the regular button block, replacing the default ones provided by the template. I have tried targeting the squarespace buttons, however the old button remains and simply gets outlined by my new button.

This is the CSS I current have in my Custom CSS:


 .sqs-block-button {
     border-top: 2px solid #30d2ff;
       background-image: 
           linear-gradient(#30d2ff, blue),
           linear-gradient(#30d2ff, blue);
       background-size:2px 100%;
       background-position:0 0, 100% 0;
       background-repeat:no-repeat;
       border-bottom: 2px solid blue;
       border-radius: 3px;
       color: black;
       background-color: white; 
       display: inline-block;
   }

Am I targeting the wrong element or is what I'm asking impossible?

Thanks in advance.

Link to comment
  • Replies 3
  • Created
  • Last Reply

It should be possible but you haven't provided a link to your site (something.squarespace.com).

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment

The example above was the following CSS applied to your medium button on your example site. To set medium buttons to look like this, I amended your CSS as follows:


.medium-button-style-outline .sqs-block-button .sqs-block-button-element--medium {
 background-image: linear-gradient(#30d2ff, blue), linear-gradient(#30d2ff, blue);
 background-size:2px 100%;
 background-position:0 0, 100% 0;
 background-repeat:no-repeat;
 border-top: 2px solid #30d2ff;
 border-bottom: 2px solid blue;
 border-radius: 3px;
 color: grey;
 display: inline-block;
 border-width: 2px;
 border-left: 0;
 border-right:0;
 border-style: transparent;
}

.medium-button-style-outline .sqs-block-button .sqs-block-button-element--medium:hover{
 background-color: transparent; /* or other hover color */
 color: black;
}

I hope that helps.

Paul

Like other moderators on this forum, I post answers to help fellow Squarespace users understand how to customise their sites.
If I've correctly answered your question, please Accept the answer by clicking Accept below. If it didn't help, feel free to ask for more help or wait for forum users to add their comments and/or answers.

To everyone else who reads this answer and finds it helpful, please vote it up using the up arrow. This will let other users know it's a good answer.
For more useful Squarespace tips see our website.

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • 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.