Skip to content

Commit

Permalink
refactor: header-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Dec 20, 2024
1 parent 93f1ebe commit f8a5728
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 112 deletions.
70 changes: 70 additions & 0 deletions source/4-user-interface/header-bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
body:not(.normal-header-bar, .is-mobile) .workspace-leaf-content {
/* the shading at the end of the header */
& .view-header-title-container::after {
display: none;
}

& .view-header-breadcrumb {
color: var(--text-faint);
font-size: 0.9rem;
}

/* hide the header & most buttons */
& .view-header {
height: 0;
border: none;

& .view-header-nav-buttons,
& .view-header-title,
& .view-action:nth-last-child(2) {
display: none;
}
}

/* position remaining buttons (by default only the "more options" button) */
& .view-header .view-actions {
position: absolute;
top: 4px;
right: 2px;

&:last-child:hover {
background: none;
}

&:last-child svg {
width: 20px;
height: 20px;
}
}

/* move header bar content to the right */
& .view-header-title-container {
position: absolute;
top: 35px;
right: 1.1rem;
transition-duration: var(--anim-duration-moderate);
transform: rotate(270deg);
transform-origin: right;

.workspace-leaf-content[data-type="kanban"] & {
display: none;
}
}

/* adjustments for PDFs */
&.workspace-leaf-content[data-type="pdf"] {
& .view-header-title-container {
right: 0.7rem;
}

& .pdf-viewer {
margin-right: 0.75em;
}
}
}

.view-header-breadcrumb.view-header-breadcrumb.view-header-breadcrumb.view-header-breadcrumb:hover {
color: var(--hover-accent);
cursor: var(--cursor-link);
background: none;
}
Original file line number Diff line number Diff line change
@@ -1,115 +1,3 @@
/* ───────────────────────────────────────────────── */
/** Header Bar
──────────────────────────────────────────────────── */
.workspace-leaf-content .view-header-title-container::after {
display: none;
}

body .workspace-leaf-content .view-header {
height: 37px;
padding: 0 6px;
margin-right: 0;
margin-left: 0;
background-color: var(--bg4);
}

body:not(.normal-header-bar, .is-mobile)
.workspace-leaf-content
.view-header-title-container::after,
body:not(.normal-header-bar, .is-mobile)
.workspace-leaf-content
.view-header
:is(.view-header-nav-buttons, .view-header-title),
body:not(.normal-header-bar, .is-mobile)
.workspace-leaf-content
.view-header
.view-action:nth-last-child(2) {
display: none;
}

body:not(.normal-header-bar, .is-mobile) .workspace-leaf-content .view-header {
height: 0;
border: none;
}

/* Note Path Breadcrumbs */
body:not(.normal-header-bar, .is-mobile) .workspace-leaf-content .view-header-title-container {
position: absolute;
top: 35px;
right: 1.1rem;
transition-duration: var(--anim-duration-moderate);
transform: rotate(270deg);
transform-origin: right;
}

/* account for pdf header */
body:not(.normal-header-bar, .is-mobile)
.workspace-leaf-content[data-type="pdf"]
.view-header-title-container {
top: 75px;
right: 0.7rem;
}

.view-header-breadcrumb.view-header-breadcrumb:hover {
color: var(--hover-accent);
cursor: var(--cursor-link);
background: none;
}

body:not(.normal-header-bar, .is-mobile) .view-header-breadcrumb {
color: var(--text-faint);
font-size: 0.9rem;
}

/* remaining buttons (by default only the "more options" button) */
body:not(.normal-header-bar, .is-mobile) .workspace-leaf-content .view-header .view-actions {
position: absolute;
top: 4px;
right: 2px;
}

body:not(.normal-header-bar, .is-mobile)
.workspace-leaf-content
.view-header
.view-action:last-child:hover {
background: none;
}

body:not(.normal-header-bar, .is-mobile)
.workspace-leaf-content
.view-header
.view-action:last-child
svg {
width: 20px;
height: 20px;
}

/* interactions */
.workspace-leaf-content[data-type="kanban"] .view-header-title-container {
display: none;
}

/** PDF Toolbar
/* avoid collision with three-dot-menu */
body:not(.normal-header-bar, .is-mobile) .pdf-toolbar {
padding-right: 32px;
}

/* avoid traffic lights */
.hide-tabbar-when-one-tab.mod-macos:not(
.show-sidebar-header-buttons,
.normal-header-bar,
.is-mobile
)
.workspace:not(.is-left-sidedock-open)
.pdf-toolbar {
padding-left: 60px;
}

/* ───────────────────────────────────────────────── */
/** Tab Bar
──────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────── */
/** Hide Various Elements
──────────────────────────────────────────────────── */
Expand Down

0 comments on commit f8a5728

Please sign in to comment.