Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Removing the sidebar in sugarcube in Twine 2?

The following code no longer works:

#sidebar {
display: none;
}

Is there a new css command for the sidebar in Twine 2 for sugarcube?

Comments

  • The element ID of the SugarCube side-bar in both Twine 1 & 2 is ui-bar

    The following CSS will cause it to not be displayed:

    #ui-bar {
    display: none;
    }
    If you want to reclaim the horizontal space where the side-bar used to be displayed then you will need to modify the body tag's left margin:

    body {
    margin-left: 3.5em;
    }
    note: You may be thinking of the Twine 1 Sugarcane story format which has a side-bar with an element ID of sidebar
  • weird. I used sidebar from way back then.


    Thanks!
  • greyelf wrote:

    note: You may be thinking of the Twine 1 Sugarcane story format which has a side-bar with an element ID of sidebar


    Bingo!
  • Hi! The ui-bar display code works great, hiding the sidebar. I'm working with the Hypercane story format CSS and even with the margin-left setting, the box for text still appears justified to the right. I'm going to mess with it, but do you have any thoughts on fixing this?

    Thank you,
  • greyelf wrote: »
    The element ID of the SugarCube side-bar in both Twine 1 & 2 is ui-bar

    The following CSS will cause it to not be displayed:

    #ui-bar {
    display: none;
    }


    If you want to reclaim the horizontal space where the side-bar used to be displayed then you will need to modify the body tag's left margin:

    body {
    margin-left: 3.5em;
    }


    note: You may be thinking of the Twine 1 Sugarcane story format which has a side-bar with an element ID of sidebar


    Uhm, I'm having a weird problem on the margin. The UI bar code worked perfectly, but the code for the horizontal space isn't working for me. I even tried using only this:



    body {
    margin-left: 3.5em;
    }
    #ui-bar {
    display: none;
    }



    But it still not working. What am I doing wrong? :(
  • I know this is an old thread, but I'm having the same issue as foreignsubstances was. I can't correct the margin size with the code greyelf posted, although the sidebar will disappear.

    I'm using Sugarcane 2.10.0.

    Any tips? :smile:
  • Sorry. By "Sugarcane," I meant "Sugarcube..."
  • For SugarCube v2 (currently: v2.12.0), the way to actually remove the UI bar and its styles, which are what reserves space for it on the left side of the page, is via a little JavaScript.

    Here's what you need: (Twine 2: goes in Story JavaScript; Twine 1: goes in a script-tagged passage)
    $('#ui-bar').remove();
    $(document.head).find('#style-ui-bar').remove();
    
  • Perfect! That took care of it. Thanks for writing back so soon.

    Yeah, I did see there had been a couple of updates when looking at the SugarCube documentation earlier. I'll probably go download v2.12.0 now...
Sign In or Register to comment.