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

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, 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

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, 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

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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.