Jump to content

Remove padding from gallery block

Recommended Posts

I have a gallery block that contains only a video, and I'd like the thumbnail to fill the section vertically. Currently, Squarespace is adding padding to the top and bottom. If I inspect the section and change "--inset-padding: 0vw;" to "--inset-padding: 0;" the padding goes away, but I'm having problems getting the same result via CSS. 

See attached images.

inset-padding-0.png

inset-padding-0vw.png

Edited by adamsson
Link to comment
On 3/9/2023 at 1:07 AM, adamsson said:

Try adding to Design > Custom CSS

/* fill section */
.fe-6408b937f1378f5967d3e203 {
    --inset-padding: 0 !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/10/2023 at 4:24 AM, tuanphan said:

Try adding to Design > Custom CSS

/* fill section */
.fe-6408b937f1378f5967d3e203 {
    --inset-padding: 0 !important;
}

 

That works! I will have 30 pages like this, each with two of these gallery blocks. Is there some way to avoid having 60 of these CSS blocks? Aside from changing the design?

Link to comment
12 hours ago, tuanphan said:

Use a code like this, it will target all sections with height 51%

/* fill section */
[data-current-styles*='"customSectionHeight": 51'] .fluid-engine {
    --inset-padding: 0 !important;
}

 

Thank you!

So close! I set the section height to 1% and made the corresponding CSS change, and it's almost perfect. There's still a small border at the top and bottom of the section.

In the browser inspector, I can see that there's a calculation being run for the top and bottom padding:

    padding-top: calc(1vmax / 10);
    padding-bottom: calc(1vmax / 10);

But my attempt at zeroing those out in the CSS failed. I'm guessing that I'm missing something?

/* fill section */
[data-current-styles*='"customSectionHeight": 1'] .fluid-engine {
    --inset-padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

Screenshot 2023-03-15 at 10.49.20 AM.png

Link to comment
On 3/15/2023 at 9:50 PM, adamsson said:

Thank you!

So close! I set the section height to 1% and made the corresponding CSS change, and it's almost perfect. There's still a small border at the top and bottom of the section.

In the browser inspector, I can see that there's a calculation being run for the top and bottom padding:

    padding-top: calc(1vmax / 10);
    padding-bottom: calc(1vmax / 10);

But my attempt at zeroing those out in the CSS failed. I'm guessing that I'm missing something?

/* fill section */
[data-current-styles*='"customSectionHeight": 1'] .fluid-engine {
    --inset-padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

Screenshot 2023-03-15 at 10.49.20 AM.png

Try this

/* fill section */
[data-current-styles*='"customSectionHeight": 51'] .content-wrapper {
    padding: 0 !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/14/2023 at 10:32 PM, tuanphan said:

Use a code like this, it will target all sections with height 51%

/* fill section */
[data-current-styles*='"customSectionHeight": 51'] .fluid-engine {
    --inset-padding: 0 !important;
}

 

I went back to this original code, but it turns out that it caused significant issues with the editor elsewhere on the page, so I commented it out.

Link to comment
On 3/27/2023 at 10:25 PM, adamsson said:

lerners

On 3/22/2023 at 11:13 PM, adamsson said:

I went back to this original code, but it turns out that it caused significant issues with the editor elsewhere on the page, so I commented it out.

What is problem with this code? I just tried & see no problem here

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 10 months later...

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.