Skip to content

Commit

Permalink
Merge pull request #230 from pryley/fix/199
Browse files Browse the repository at this point in the history
fixes #199
  • Loading branch information
AnubisNekhet authored Oct 25, 2023
2 parents 91e8c73 + 333b01c commit fa42316
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 104 deletions.
56 changes: 22 additions & 34 deletions obsidian.css
Original file line number Diff line number Diff line change
Expand Up @@ -3786,63 +3786,51 @@ body.is-translucent {
--title-bar-duration: 300ms;
--title-bar-target-translate-y: 18px;
--title-bar-translate-y: 40px;
--title-bar-windows-fix: 5;
/**
* This should fix the drag/click titlebar issue.
*
* Invisible boxes are not rendered (as if they were fully transparent),
* cannot be interacted with (and behave as if they had pointer-events: none),
* and are removed from navigation (similar to display: none).
*
* @see: https://drafts.csswg.org/css-display/#visibility
*/
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header {
margin-top: calc(var(--title-bar-translate-y) * -1);
position: relative;
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), margin-right 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), margin-left 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), padding 0s calc(var(--title-bar-duration) + var(--title-bar-delay));
margin-left: 80px;
margin-right: 80px;
}
.anp-autohide-titlebar:not(.is-mobile):not(.mod-macos) .workspace-tabs:is(.mod-top-right-space, .mod-top-left-space) .workspace-leaf-content .view-header {
margin-right: calc(var(--title-bar-windows-fix) * var(--frame-right-space));
padding: 0;
}
.anp-autohide-titlebar:not(.is-mobile):not(.mod-macos) .workspace-tabs:is(.mod-top-right-space, .mod-top-left-space) .workspace-leaf-content .view-header:is(:hover, :focus-within) {
margin-right: 0;
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s, padding 0s;
padding: 0 var(--size-4-3);
}
.anp-autohide-titlebar:not(.is-mobile):not(.mod-macos) .workspace-tabs:is(.mod-top-right-space, .mod-top-left-space) .workspace-leaf-content .view-header::before {
width: calc(100% + var(--title-bar-windows-fix) * var(--frame-right-space));
top: var(--header-height);
transition: transform var(--title-bar-duration) var(--title-bar-delay);
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header::before {
bottom: calc(var(--title-bar-target-translate-y) * -1);
content: "";
left: -80px;
left: 0;
position: absolute;
top: 0;
transition: transform var(--title-bar-duration) var(--title-bar-delay);
width: calc(100% + 160px);
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay);
width: 100%;
z-index: 0;
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:is(:hover, :focus-within)::before {
transform: translateY(var(--title-bar-target-translate-y));
left: 0px;
width: 100%;
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:is(:hover, :focus-within),
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:is(:hover, :focus-within) + .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s, margin-left 0s, padding 0s calc(var(--title-bar-duration) + var(--title-bar-delay));
transform: translateY(var(--title-bar-translate-y));
margin-left: 0;
margin-right: 0;
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:not(:hover, :focus-within) .clickable-icon {
app-region: drag;
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay);
}
.anp-autohide-titlebar:not(.is-mobile) .view-header::before {
z-index: 0;
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header-title {
--file-header-font-size: var(--font-ui-medium);
}
.anp-autohide-titlebar:not(.is-mobile) .view-header > div {
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header > div {
transition: visibility var(--title-bar-duration) var(--title-bar-delay);
visibility: visible;
z-index: 1;
}
.anp-autohide-titlebar:not(.is-mobile) .view-header-title {
--file-header-font-size: var(--font-ui-medium);
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:not(:hover, :focus-within) > div {
visibility: hidden;
}

body:not(.anp-alternate-tab-toggle):not(.anp-disable-newtab-align) .workspace-split.mod-vertical .workspace-tab-header-spacer {
Expand Down
59 changes: 23 additions & 36 deletions src/modules/Workspace/tabtitlebar.scss
Original file line number Diff line number Diff line change
@@ -1,66 +1,53 @@
.anp-autohide-titlebar:not(.is-mobile) {

--title-bar-delay: 150ms;
--title-bar-duration: 300ms;
--title-bar-target-translate-y: 18px;
--title-bar-translate-y: 40px;
--title-bar-windows-fix: 5;

.workspace-leaf-content .view-header {
margin-top: calc(var(--title-bar-translate-y) * -1);
position: relative;
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), margin-right 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), margin-left 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), padding 0s calc(var(--title-bar-duration) + var(--title-bar-delay));
margin-left: 80px;
margin-right: 80px;
}
//hacky windows fix
&:not(.mod-macos) .workspace-tabs:is(.mod-top-right-space, .mod-top-left-space) .workspace-leaf-content .view-header {
margin-right: calc(var(--title-bar-windows-fix)*var(--frame-right-space));
padding: 0;
&:is(:hover,:focus-within) {
margin-right: 0;
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s, padding 0s;
padding: 0 var(--size-4-3);
}
&::before {
width: calc(100% + var(--title-bar-windows-fix)*var(--frame-right-space));
top: var(--header-height);
}
transition: transform var(--title-bar-duration) var(--title-bar-delay);
}
.workspace-leaf-content .view-header::before {
bottom: calc(var(--title-bar-target-translate-y) * -1);
content: '';
left: -80px;
left: 0;
position: absolute;
top: 0;
transition: transform var(--title-bar-duration) var(--title-bar-delay);
width: calc(100% + 160px);
}
.workspace-leaf-content .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay);
width: 100%;
z-index: 0;
}
.workspace-leaf-content .view-header:is(:hover,:focus-within)::before {
transform: translateY(var(--title-bar-target-translate-y));
left: 0px;
width: 100%;
}
.workspace-leaf-content .view-header:is(:hover,:focus-within),
.workspace-leaf-content .view-header:is(:hover,:focus-within) + .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s, margin-left 0s, padding 0s calc(var(--title-bar-duration) + var(--title-bar-delay));
transform: translateY(var(--title-bar-translate-y));
margin-left: 0;
margin-right: 0;
}
.workspace-leaf-content .view-header:not(:hover,:focus-within) .clickable-icon {
app-region: drag;
.workspace-leaf-content .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay);
}
.view-header::before {
z-index: 0;
.workspace-leaf-content .view-header-title {
--file-header-font-size: var(--font-ui-medium);
}
.view-header > div {

/**
* This should fix the drag/click titlebar issue.
*
* Invisible boxes are not rendered (as if they were fully transparent),
* cannot be interacted with (and behave as if they had pointer-events: none),
* and are removed from navigation (similar to display: none).
*
* @see: https://drafts.csswg.org/css-display/#visibility
*/
.workspace-leaf-content .view-header > div {
transition: visibility var(--title-bar-duration) var(--title-bar-delay);
visibility: visible;
z-index: 1;
}
.view-header-title {
--file-header-font-size: var(--font-ui-medium);
.workspace-leaf-content .view-header:not(:hover,:focus-within) > div {
visibility: hidden;
}
}
56 changes: 22 additions & 34 deletions theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -3786,63 +3786,51 @@ body.is-translucent {
--title-bar-duration: 300ms;
--title-bar-target-translate-y: 18px;
--title-bar-translate-y: 40px;
--title-bar-windows-fix: 5;
/**
* This should fix the drag/click titlebar issue.
*
* Invisible boxes are not rendered (as if they were fully transparent),
* cannot be interacted with (and behave as if they had pointer-events: none),
* and are removed from navigation (similar to display: none).
*
* @see: https://drafts.csswg.org/css-display/#visibility
*/
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header {
margin-top: calc(var(--title-bar-translate-y) * -1);
position: relative;
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), margin-right 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), margin-left 0s calc(var(--title-bar-duration) + var(--title-bar-delay)), padding 0s calc(var(--title-bar-duration) + var(--title-bar-delay));
margin-left: 80px;
margin-right: 80px;
}
.anp-autohide-titlebar:not(.is-mobile):not(.mod-macos) .workspace-tabs:is(.mod-top-right-space, .mod-top-left-space) .workspace-leaf-content .view-header {
margin-right: calc(var(--title-bar-windows-fix) * var(--frame-right-space));
padding: 0;
}
.anp-autohide-titlebar:not(.is-mobile):not(.mod-macos) .workspace-tabs:is(.mod-top-right-space, .mod-top-left-space) .workspace-leaf-content .view-header:is(:hover, :focus-within) {
margin-right: 0;
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s, padding 0s;
padding: 0 var(--size-4-3);
}
.anp-autohide-titlebar:not(.is-mobile):not(.mod-macos) .workspace-tabs:is(.mod-top-right-space, .mod-top-left-space) .workspace-leaf-content .view-header::before {
width: calc(100% + var(--title-bar-windows-fix) * var(--frame-right-space));
top: var(--header-height);
transition: transform var(--title-bar-duration) var(--title-bar-delay);
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header::before {
bottom: calc(var(--title-bar-target-translate-y) * -1);
content: "";
left: -80px;
left: 0;
position: absolute;
top: 0;
transition: transform var(--title-bar-duration) var(--title-bar-delay);
width: calc(100% + 160px);
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay);
width: 100%;
z-index: 0;
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:is(:hover, :focus-within)::before {
transform: translateY(var(--title-bar-target-translate-y));
left: 0px;
width: 100%;
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:is(:hover, :focus-within),
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:is(:hover, :focus-within) + .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay), margin-right 0s, margin-left 0s, padding 0s calc(var(--title-bar-duration) + var(--title-bar-delay));
transform: translateY(var(--title-bar-translate-y));
margin-left: 0;
margin-right: 0;
}
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:not(:hover, :focus-within) .clickable-icon {
app-region: drag;
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-content {
transition: transform var(--title-bar-duration) var(--title-bar-delay);
}
.anp-autohide-titlebar:not(.is-mobile) .view-header::before {
z-index: 0;
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header-title {
--file-header-font-size: var(--font-ui-medium);
}
.anp-autohide-titlebar:not(.is-mobile) .view-header > div {
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header > div {
transition: visibility var(--title-bar-duration) var(--title-bar-delay);
visibility: visible;
z-index: 1;
}
.anp-autohide-titlebar:not(.is-mobile) .view-header-title {
--file-header-font-size: var(--font-ui-medium);
.anp-autohide-titlebar:not(.is-mobile) .workspace-leaf-content .view-header:not(:hover, :focus-within) > div {
visibility: hidden;
}

body:not(.anp-alternate-tab-toggle):not(.anp-disable-newtab-align) .workspace-split.mod-vertical .workspace-tab-header-spacer {
Expand Down

0 comments on commit fa42316

Please sign in to comment.