Adding padding to a section .liquid file, to the .css file or to the .js file?

Topic summary

A user is trying to add padding to a Video Background section in the Prestige Shopify theme. The desktop view works fine, but on mobile the heading text disappears and bottom margin/padding is missing, creating an awkward gap.

Initial confusion: The user was unsure whether to modify the .liquid section file, CSS, or JavaScript, and couldn’t locate the relevant code controlling the heading visibility or padding.

Solution provided: Another user recommended adding custom CSS directly to the theme.liquid file (below the <head> tag):

  • To add bottom margin: .Image_Hero__videoHolder { margin-bottom: 20px; }
  • To remove black background from heading: .videoBackground .videoBox .boxInfo { background: transparent !important; }

Key learning: The issue was CSS-related. The helper advised using browser inspect tools to identify the correct CSS selectors (like .videoBox and .boxInfo) rather than searching through theme files. No official documentation exists for these specific customizations—inspection is the primary method for finding the right selectors.

Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

I’m trying to add padding to a Video Background section (Prestige theme) on our site’s homepage and I’m struggling to figure out where exactly to configure this.

Basically, the desktop view is great, but I’d like to edit the mobile view, because the heading text disappears in this view, and the margin/padding on the bottom disappears, leaving a silly looking lack of a gap.

So I thought "surely this is taken care of with JavaScript (since I saw nothing that related to conditional rendering in the respective section .liquid file). But I can’t seem to locate anything to do with the heading text, nor can I determine what the object is that I should add the padding to and where the if statement is that dictates whether the text appears or not.

I’m aware that this could be a CSS issue, and that the heading is present but not appearing because of some responsiveness bug, but I’m not clear and I’d very much appreciate some guidance.

The below code is the module for the BackgroundVideoSection.

var BackgroundVideoSection = function () {
    function BackgroundVideoSection(container) {
      _classCallCheck(this, BackgroundVideoSection);

      this.element = container;
      this.options = JSON.parse(this.element.getAttribute('data-section-settings'));

      this._loadScript().then(this._setupPlayer.bind(this));
    }

    _createClass(BackgroundVideoSection, [{
      key: '_loadScript',
      value: function _loadScript() {
        var _this27 = this;

        return new Promise(function (resolve, reject) {
          var script = document.createElement('script');
          document.body.appendChild(script);
          script.onload = resolve;
          script.onerror = reject;
          script.async = true;
          script.src=_this27.options['videoType'] === 'youtube' ? '//www.youtube.com/iframe_api' : '//player.vimeo.com/api/player.js';
        });
      }
    }, {
      key: 'onUnload',
      value: function onUnload() {
        if (this.player) {
          this.player.destroy(); // Both YouTube and Vimeo use the same function name
        }
      }
    }, {
      key: '_setupPlayer',
      value: function _setupPlayer() {
        var _this28 = this;

        var elementToInsert = this.element.querySelector('.ImageHero__VideoHolder');

        var playerLoadingInterval = setInterval(function () {
          if (_this28.options['videoType'] === 'youtube') {
            if (window.YT) {
              _this28.player = new YT.Player(elementToInsert, {
                videoId: _this28.options['videoId'],
                playerVars: {
                  showinfo: 0,
                  controls: 0,
                  fs: 0,
                  rel: 0,
                  height: '100%',
                  width: '100%',
                  iv_load_policy: 3,
                  html5: 1,
                  loop: 1,
                  playsinline: 1,
                  modestbranding: 1,
                  disablekb: 1,
                  origin: _this28.options['requestHost']
                },
                events: {
                  onReady: _this28._onYouTubeReady.bind(_this28),
                  onStateChange: _this28._onYouTubeStateChange.bind(_this28)
                }
              });

              clearInterval(playerLoadingInterval);
            }
          } else {
            if (window.Vimeo) {
              _this28.player = new Vimeo.Player(elementToInsert.parentNode, {
                id: _this28.options['videoId'],
                autoplay: true,
                muted: true,
                background: true,
                /*height: '100%',
                width: '100%',*/
                loop: true
              });
            }
          }
        }, 50);
      }
    }, {
      key: '_onYouTubeReady',
      value: function _onYouTubeReady(event) {
        this.player.mute();
        this.player.playVideo();
      }
    }, {
      key: '_onYouTubeStateChange',
      value: function _onYouTubeStateChange(event) {
        if (event.data === YT.PlayerState.ENDED) {
          this.player.playVideo();
        }
      }
    }]);

    return BackgroundVideoSection;
  }();
  /* harmony export (immutable) */

  __webpack_exports__["default"] = BackgroundVideoSection;

  /***/
},

Hey @Tdubbs ,

Go to your theme’s “Edit Code” Option, then in the search bar type “theme.liquid”
Below the tag “” tag paste the following. Screenshot attached for reference.

Increase or decrease the 20px value as you like to change the margin below the video section.


Screenshot is for reference only, the correct code to paste is the one shown above.

1 Like

That’s incredibly helpful!

Only remaining issue is that the heading now has a black background to it. Is there some documentation to show what these properties are? How did you know what to edit here?

This will get rid of the black background. The instructions are the same as above.


Regarding your next question, no there’s no documentation. I just see what the code is doing.

1 Like

Well thanks a lot. I guess I really need to brush up on my css. Could you tell me where you found ‘.videoBox’ and ‘.videoBackground .videoBoxInfo’? I was looking for something like that myself but couldn’t find them in the files. I guess I should have just inspected the page!

Yeah Inspect the page and then look through the code.