Jump to content

Target ALL BUTTONS with CSS?

Recommended Posts

1 hour ago, NadineCharleson said:

Is it just me, or do you want a way to target ALL  buttons with CSS across a site? Is there a reason this isn't possible with CSS? Maybe I'm just new?... What are your thoughts? 😅

Button on squarespace may have many types: button tag, a tag. So if you can share your site with protected password so we can take a look at yours 'buttons'

Edited by bangank36

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 4 weeks later...

Thanks @bangank36, but I'm just looking for a general "all buttons" option. I'd like that ability for creating templates so if users add a block I don't use, the design isn't messed up. I can manually do the CSS for the ones I use etc, but I'd love an option to just target all buttons. 

Or even "all primary" buttons etc.

On 10/12/2022 at 9:06 PM, bangank36 said:

Button on squarespace may have many types: button tag, a tag. So if you can share your site with protected password so we can take a look at yours 'buttons'

 

Link to comment
6 hours ago, NadineCharleson said:

Thanks @bangank36, but I'm just looking for a general "all buttons" option. I'd like that ability for creating templates so if users add a block I don't use, the design isn't messed up. I can manually do the CSS for the ones I use etc, but I'd love an option to just target all buttons. 

Or even "all primary" buttons etc.

 

With Css you can select button with the following class: sqs-block-button-element

In addition, Squarespace allow you to set some style in general:

image.thumb.png.b22840dd735f72af2ba2a9848036b8da.png

 

image.thumb.png.10d2b04d5302ead0cdfd963cd05a7d97.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Yeah, I get that. But I'm needing it for doing custom animations or cool CSS things with them. I can't just target *all buttons*. Seems silly that it's not an option, but c'est la vie!

PS. For example, newsletter blocks, header blocks, form blocks, collection list buttons... you get the idea. I'd love a master reference in CSS for "all buttons"...

Edited by NadineCharleson
Link to comment
On 10/13/2022 at 12:48 AM, NadineCharleson said:

Is it just me, or do you want a way to target ALL buttons with CSS across a site?

There isn't one single selector that you can use to target all buttons because Squarespace is constantly evolving and different elements were built at different times. You can apply your CSS to several buttons, but you'll need to identify the right selectors for each button and then combine them in one CSS statement (usually by separating them with commas). 

Areas of the platform that were built or updated very recently are generally easier to work with because some standardisation has kicked in. For example, new buttons generally have Primary, Secondary and Tertiary classes like sqs-button-element--primary, sqs-button-element--secondary and so on, and this can be very helpful. However, there are areas of the platform that are much older - dating back 10 years in some cases - these use many different HTML elements and classes. To complicate things further, older classes are retained for backward compatibility (to prevent custom code breaking) so you may find a single button has many different classes like:

  • button-block
  • sqs-block-button
  • sqs-block-button-element
  • sqs-block-button-element--medium
  • sqs-button-element--secondary
  • ..and so on.

 

Did this help? Please give feedback by clicking an icon below  ⬇️

Edited by paul2009

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation 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.

Buy me a coffee

Link to comment

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.