I am trying to get rid of the navbar. I have extended the vanilla theme. Other than this experimentation, I have made very few changes, just to remove presentation of the survey title in various places.
I edited nav_bar.twig and commented out the div for the element with aSurveyInfo.class.navbarbrand. This successfully removes the navbar content from the survey, but still leaves a gap at the top of the survey caused by padding-top style on the body element.
In an attempt to handle that issue, I edited custom.css and added the following:
Code:
body { padding-top: 0px; }
This successfully adjusts the body style, but something else is adding style="padding-top: 49px;" to the body element, and I can't figure out the culprit.
This is what my body element looks like rendered, after making those changes:
Code:
<body class=" extends_vanilla vanilla font-noto lang-en " style="padding-top: 49px;">
I have tried several workarounds, none of which work completely.
I tried a hack using javascript, by editing custom.js and adding:
Code:
$(document).ready(function(){
$('body').css('padding-top', '0px');
});
This works in terms of the final page rendered, but results in a visible jump as the content is loaded and then shifted up. This happens for every page in the survey using this method.
I tried deleting completely the {% block nav_bar %} ... {% endblock %} section in layout_global.twig but this results in a reference error (presumably some code is trying to set a property on something created by the code inserted by the nav_bar template block.
Any suggestions? Ideally I'd like to do this the cleanest way using the template editor or other configuration, but suggestions for any workarounds that are functional would be appreciated as well.