Jump to content

How do I target a section 'sectionTheme'

Recommended Posts

Posted
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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

  • 1 year later...
Posted
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)

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.