question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

option to put sidebar on the right

See original GitHub issue

Feature request

An option to put the sidebar on the right instead of the left

What problem does this feature solve?

Sometimes people want it on the other side (maybe they embed Docsify somewhere that already has a sidebar on the left, or maybe they have a custom landing page with a custom menu on the right and when they click the link to go to documentation they’d also want the docs to have the sidebar on the same side).

What does the proposed API look like?

rightSidebar: true // or false

or

sidebarPosition: 'right' // or 'left'

How should this be implemented in your opinion?

I think we might be able to achieve this just with CSS, leaving the markup alone.

cc @jhildenbiddle for CSS expertise here.

Are you willing to work on this yourself?

Of course (if/when I get the time)!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
trusktrcommented, Jul 13, 2020

Turns out it was easy to do, it took only a few minutes to modify 3 numbers in the CSS:

Of course the menu icon should be re-positioned too.

I’ll make a draft PR once I circle back (I’d like to finish the SSR tests in the other PR).

1reaction
trusktrcommented, Mar 28, 2021

@paulhibbitts See these lines:

https://github.com/docsifyjs/docsify/blob/c2cf163fc0a02378f27792ce58ac6e5fc5a8bf65/src/themes/basic/_layout.styl#L209

(try changing left to right)

https://github.com/docsifyjs/docsify/blob/c2cf163fc0a02378f27792ce58ac6e5fc5a8bf65/src/themes/basic/_layout.styl#L423

(Similar, position from the right)

https://github.com/docsifyjs/docsify/blob/c2cf163fc0a02378f27792ce58ac6e5fc5a8bf65/src/themes/basic/_layout.styl#L443

(Possibly negate a number if it moves the wrong direction)

That’s about it! Oh, and the sidebar hamburger button needs to be repositioned to the right as well.

Adding an option could simply set, for example, a CSS var to tell the styling to use left or right in a non-breaking way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Sidebars: A Beginner's Guide - HubSpot Blog
Learn how to code your own website sidebar using CSS and HTML. We'll explain static, fixed, sticky, grid, and collapsible sidebars and how ......
Read more >
How to use the Google Sidebar | Including Options and Settings
Google Sidebar Settings and Options a How to Guide: This tutorial ... how to install Google Workspace add -ons to the Google Right...
Read more >
Can't get my sidebar on the right-hand side - Stack Overflow
I'm an amateur with CSS and have tried using some guides to get myself so far. I've set up a fiddle http://jsfiddle.net/defaye/X9t7M/1/ for ......
Read more >
Use sidebars in Pages on Mac - Apple Support
Right sidebar : Click Format or Document in the toolbar to open the sidebar and show the controls. To close the sidebar, click...
Read more >
How to Add a Sidebar to the Desktop in Windows 10 & 11
Dock Location and ; Left or ; Right. Add transparency to the sidebar by dragging the slider for the ; Set opacity bar...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found