Skip to content

New hider option: hide pinned tabs titles#7

Open
biozz wants to merge 1 commit intokepano:masterfrom
biozz:master
Open

New hider option: hide pinned tabs titles#7
biozz wants to merge 1 commit intokepano:masterfrom
biozz:master

Conversation

@biozz
Copy link

@biozz biozz commented Mar 28, 2024

Hi!

Thank you for the Hider plugin, I really enjoy using it to unclutter my Obsidian setup!

Couple of weeks ago I had to share my screen with an Obsidian window and didn't want people to see some of the tabs titles. I remembered how I do that in my web browser. I usually just pin the tab and there is no title, only the favicon. That way I don't have to close it, people watching my screen are not distracted by the titles of the open tabs and I can still come back to these tabs later on.

I went to check what existing plugins had to offer and didn't find anything. So I went ahead and figured out this CSS snippet with some help from my colleagues:

.workspace-tab-header-inner-title:has(+ .workspace-tab-header-status-container .mod-pinned) {
  display: none;
}
.workspace .mod-root .workspace-tab-header:has(.mod-pinned) {
  width: unset;
  min-width: unset;
  flex: unset;
}

It is kind of complicated and hard to understand, because it uses a tricky syntax to find if there is a parent element which has .mod-pinned class. But it works. There are also some fixes related to reduction of the extra whitespace.

It simulates what browsers do, except that pinned tabs in Obsidian can still be moved around.

The result looks like this:

image

And it works much better with Iconize plugin, because it adds more area to drag the tab around and also looks like favicons in the browser. Here is an example:

image

I tried my best to keep the structure of your plugin and also updated readme. Not sure if I had to update manifest and versions files. Please let me know if I should, I would be happy to do so!

@yuanzhengdelu
Copy link

可以隐藏那个帮助栏嘛?就是带有“?”的那个一排工具。我发现你的插件隐藏标题后,那个工具会阻碍到关闭选项。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants