Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Provide CSS variable for sidebar width #3485

Closed
rtgibbons opened this issue Mar 13, 2024 · 2 comments
Closed

[Enhancement] Provide CSS variable for sidebar width #3485

rtgibbons opened this issue Mar 13, 2024 · 2 comments

Comments

@rtgibbons
Copy link

I was playing around with layout of the sidebar and nav-bar. I'm looking for the ability to get the sidebar width and be able to use that in userChrome.css. I've tried searching and looking around for it and haven't stumbled on it yet. Is it possible to set this as a CSS variable for use in the Browsers scope?

What I'm looking to do is to move the #nav-bar dynamically based on the width of sidebar (see Safari). Attached is a screenshot of what it looks like in Firefox now, but if I resize the sidebar, the #nav-bar doesn't move. which can case the sidebar to go "on top" of the navigation buttons.

CleanShot 2024-03-13 at 13 46 18

Here is my userChrome.css that gets me what I have done to date (still a few small tweaks needed)

/* Remove TreeStyleTab header from top of sidebar */
:root {
  --x-sidebar-static-width: 250px;
  --x-urlbar-height: 40px;
}

#nav-bar:not([tabs-hidden="true"]) {
  left: var(--x-sidebar-static-width);
  width: calc(100% - var(--x-sidebar-static-width));
}

#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"]
  #sidebar-header {
  display: none;
}

/* Adjust sidebar and titlebar for modern layout */
#sidebar-box {
  width: var(--x-sidebar-static-width) !important;
  position: relative;
  top: calc(-1 * var(--x-urlbar-height));
  padding-top: var(--x-urlbar-height);
}
@piroor
Copy link
Owner

piroor commented Mar 14, 2024

TST is now a WebExtensions addon so it cannot expose anything CSS variable to the chrome area. You may need to do something hack like userChrome.js.

@rtgibbons
Copy link
Author

Thanks , I'll have to hack around with this and see what I can come up with. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants