Skip to content

Commit b8186b7

Browse files
committed
refactor: sidebar header hiding
1 parent 5c6c506 commit b8186b7

File tree

2 files changed

+57
-60
lines changed

2 files changed

+57
-60
lines changed
Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ───────────────────────────────────────────────── */
2-
/** Sidebars
2+
/** Sidebar content
33
──────────────────────────────────────────────────── */
44

55
/* do not trim filenames while renaming */
@@ -14,18 +14,65 @@
1414
right: 0;
1515
}
1616

17+
.nav-file-title,
18+
.nav-folder-title {
19+
margin-top: 0;
20+
margin-bottom: 0;
21+
border-radius: 0;
22+
}
23+
1724
/* ───────────────────────────────────────────────── */
1825
/** Sidebar Headers Hidden (Tab Headers)
1926
──────────────────────────────────────────────────── */
2027

28+
body:not(.show-sidebar-header-buttons) :is(.mod-left-split, .mod-right-split) {
29+
:is(
30+
.workspace-tab-header-container,
31+
.workspace-tab-header-container *,
32+
.workspace-tab-header,
33+
.workspace-tab-header svg
34+
) {
35+
transition: var(--anim-duration-moderate);
36+
transition-delay: var(--transition-delay-passing-over-protection);
37+
/* so transition of hovering the tab itself does not get delayed */
38+
transition-property: opacity, height, background-color;
39+
}
40+
41+
.workspace-tabs {
42+
&:not(.mod-top) .workspace-tab-header-container:not(:hover) {
43+
--sidebar-tabs-unhovered-height: 10px;
44+
height: var(--sidebar-tabs-unhovered-height);
45+
}
46+
47+
&.mod-top
48+
.workspace-tab-header-container:not(:hover)
49+
.workspace-tab-header-container-inner {
50+
opacity: 0;
51+
}
52+
53+
&.mod-top .workspace-tab-header-container-inner {
54+
&:hover {
55+
padding-bottom: 4px;
56+
margin-top: 4px;
57+
}
58+
padding-bottom: 0;
59+
margin-top: 0;
60+
}
61+
}
62+
}
63+
2164
/* WINDOWS / LINUX */
2265
/* fix sidebar header buttons not being clickable see #247 */
2366
body:is(.mod-windows, .mod-linux) {
2467
&:not(.show-sidebar-header-buttons) .titlebar {
2568
height: 35px;
2669
}
2770

28-
&.is-hidden-frameless:not(.is-grabbing, .is-fullscreen, .show-sidebar-header-buttons)
71+
&.is-hidden-frameless:not(
72+
.is-grabbing,
73+
.is-fullscreen,
74+
.show-sidebar-header-buttons
75+
)
2976
.mod-top
3077
.workspace-tab-header-container {
3178
-webkit-app-region: no-drag;
@@ -38,50 +85,6 @@ body:is(.mod-windows, .mod-linux).is-hidden-frameless:not(.is-fullscreen)
3885
background-color: transparent;
3986
}
4087

41-
body:not(.show-sidebar-header-buttons)
42-
:is(.mod-left-split, .mod-right-split)
43-
:is(
44-
.workspace-tab-header-container,
45-
.workspace-tab-header-container *,
46-
.workspace-tab-header,
47-
.workspace-tab-header svg
48-
) {
49-
transition: var(--anim-duration-moderate);
50-
transition-delay: var(--transition-delay-passing-over-protection);
51-
/* so transition of hovering the tab itself does not get delayed */
52-
transition-property: opacity, height, background-color;
53-
}
54-
55-
body:not(.show-sidebar-header-buttons)
56-
:is(.mod-left-split, .mod-right-split)
57-
.workspace-tabs:not(.mod-top)
58-
.workspace-tab-header-container:not(:hover) {
59-
--sidebar-tabs-unhovered-height: 10px;
60-
height: var(--sidebar-tabs-unhovered-height);
61-
}
62-
63-
body:not(.show-sidebar-header-buttons)
64-
:is(.mod-left-split, .mod-right-split)
65-
.workspace-tabs.mod-top
66-
.workspace-tab-header-container:not(:hover)
67-
.workspace-tab-header-container-inner {
68-
opacity: 0;
69-
}
70-
71-
body:not(.show-sidebar-header-buttons)
72-
:is(.mod-left-split, .mod-right-split)
73-
.workspace-tabs:not(.mod-top)
74-
.workspace-tab-header-container {
75-
background-color: var(--bg1);
76-
}
77-
78-
.theme-light:not(.show-sidebar-header-buttons)
79-
:is(.mod-left-split, .mod-right-split)
80-
.workspace-tabs:not(.mod-top)
81-
.workspace-tab-header-container:not(:hover) {
82-
background-color: var(--bg2);
83-
}
84-
8588
/* ───────────────────────────────────────────────── */
8689
/** Sidebar Styling
8790
──────────────────────────────────────────────────── */
@@ -93,6 +96,12 @@ body:not(.show-sidebar-toggle-buttons) .sidebar-toggle-button {
9396
display: none;
9497
}
9598

99+
:is(.mod-right-split, .mod-left-split)
100+
.workspace-tabs:not(.mod-top)
101+
.workspace-tab-header-container:not(:hover) {
102+
background-color: var(--bg2);
103+
}
104+
96105
.sidebar-toggle-button {
97106
height: 35px;
98107
}
@@ -103,15 +112,3 @@ body.mod-macos.is-hidden-frameless:not(.is-popout-window) .workspace
103112
.workspace-tab-header-container {
104113
padding-right: 0;
105114
}
106-
107-
.nav-file-title,
108-
.nav-folder-title {
109-
margin-top: 0;
110-
margin-bottom: 0;
111-
border-radius: 0;
112-
}
113-
114-
:is(.mod-left-split, .mod-right-split) .mod-top .workspace-tab-header-container-inner {
115-
padding-bottom: 4px;
116-
margin-top: 4px;
117-
}

types/obsidian-variables.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/* DOCS Obsidian available variables: https://docs.obsidian.md/Reference/CSS+variables/CSS+variables
22
33
INFO These values are unchanged from the default theme, but included here for
4-
autocompletion via the `css-variables` LSP: https://github.com/vunguyentuan/vscode-css-variables
4+
autocompletion via the `css-variables` LSP: https://github.com/vunguyentuan/vscode-css-variables
55
(Effectively, these work a bit like a `d.ts` file in typescript.) */
66

77
.dummy {
88
/* user setting */
9-
-font-interface: "";
9+
--font-interface: "";
1010
--font-text: "";
1111
--font-monospace: "";
1212
--font-text-size: "";

0 commit comments

Comments
 (0)