Jump to content

How do I target a section 'sectionTheme'

Recommended Posts

2 hours ago, Brent_Dickens said:

How do I target a section 'sectionTheme' using custom css.

I want to target: "sectionTheme": "light" within the: data-current-styles {}

Screen Shot 2021-05-17 at 2.57.24 PM.png

it's call attribute selector, you can use something like

[data-section-theme="white"]

 

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
  • 1 year later...
On 5/16/2021 at 10:58 PM, Brent_Dickens said:

How do I target a section 'sectionTheme' using custom css.

I want to target: "sectionTheme": "light" within the: data-current-styles {}

Screen Shot 2021-05-17 at 2.57.24 PM.png

Assuming you want to apply CSS to all sections with a light color theme assigned to them, you can use the data-section-theme attribute, or it looks like Squarespace creates a class based on the assigned color theme.

To use the attribute:
[date-section-theme="light"]

You'll notice this attribute in the first line of the <section> tag. I'm sure "light" changes to correspond with whatever color theme is chosen for that section.

To use the class:
.light

If you look at the end of the list of classes assigned to that section, you'll notice "light" show up right before the data-section-id attribute. It's sort of hidden by showing up right there, but it should work for selecting all sections with the light color theme assigned to them. The same is likely true with this class in that it changes to correspond with whatever color theme is chosen for that section.

 

Looking for help with a project?
💻 www.connectionmadedesign.com
 for hire on Upwork (Top Rated Plus)

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.