Toggle main notebook toolbar (e.g., buttons), filename,
    and kernel logo.

def toggle_settings(
        toolbar=False, nbname=False, hideprompt=False, kernellogo=False):
    """Toggle main notebook toolbar (e.g., buttons), filename,
    and kernel logo."""

    toggle = ''
    if toolbar:
        toggle += 'div#maintoolbar {margin-left: 8px !important;}\n'
        toggle += '.toolbar.container {width: 100% !important;}\n'
    else:
        toggle += 'div#maintoolbar {display: none !important;}\n'
    if nbname:
        toggle += ('span.save_widget span.filename {margin-left: 8px; height: initial;'
                   'font-size: 100%; color: @nb-name-fg; background-color:'
                   '@cc-input-bg;}\n')
        toggle += ('span.save_widget span.filename:hover {color:'
                   '@nb-name-hover; background-color: @cc-input-bg;}\n')
        toggle += ('#menubar {padding-top: 4px; background-color:'
                   '@notebook-bg;}\n')
    else:
        toggle += '#header-container {display: none !important;}\n'
    if hideprompt:
        toggle += 'div.prompt.input_prompt {display: none !important;}\n'
        toggle += 'div.prompt.output_prompt {width: 5ex !important;}\n'
        toggle += 'div.out_prompt_overlay.prompt:hover {width: 5ex !important; min-width: 5ex !important;}\n'
        toggle += (
            '.CodeMirror-gutters, .cm-s-ipython .CodeMirror-gutters'
            '{ position: absolute; left: 0; top: 0; z-index: 3; width: 2em; '
            'display: inline-block !important; }\n')
        toggle += ('div.cell.code_cell .input { border-left: 5px solid @cm-gutters !important; border-bottom-left-radius: 5px; border-top-left-radius: 5px; }\n')
    if kernellogo:
        toggle += '@kernel-logo-display: block;'
    else:
        toggle += '@kernel-logo-display: none;'

    return toggle