Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shell-bar-line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dskripchenko/ui": minor
---

`--uid-shell-bar-height` (56px): the top bar's height, and the least height of the sidebar's header, with the same `--uid-border-subtle` line — the lines under the two meet in one. The sidebar's header now centers its content vertically with no padding above and below.
8 changes: 6 additions & 2 deletions src/patterns/Sidebar/UidSidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@

/* Header / Footer */
.uid-pattern-sidebar__header {
padding: var(--uid-space-md);
border-bottom: 1px solid var(--uid-color-border);
/* As tall as the top bar, its line included: the two lines under them meet. */
display: flex;
align-items: center;
min-height: var(--uid-shell-bar-height, 56px);
padding: 0 var(--uid-space-md);
border-bottom: 1px solid var(--uid-border-subtle);
flex-shrink: 0;
}

Expand Down
10 changes: 10 additions & 0 deletions src/patterns/Sidebar/UidSidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ describe('UidSidebarItem to / RouterLink', () => {
expect(base).toMatch(/border-width:\s*0/)
})

// The line under the sidebar's header and the one under the top bar are one line (the shell bar's height).
it('the header is as tall as the top bar, with its line', () => {
const header = /\.uid-pattern-sidebar__header \{([^}]*)\}/.exec(sidebarCss)?.[1] ?? ''
const topBar = /\.uid-top-bar \{([^}]*)\}/.exec(readFileSync(resolve(process.cwd(), 'src/patterns/TopBar/UidTopBar.css'), 'utf8'))?.[1] ?? ''
expect(header).toContain('min-height: var(--uid-shell-bar-height, 56px)')
expect(topBar).toContain('height: var(--uid-shell-bar-height, 56px)')
expect(header).toContain('border-bottom: 1px solid var(--uid-border-subtle)')
expect(topBar).toContain('border-bottom: 1px solid var(--uid-border-subtle)')
})

// A <button> item would show the browser's own button: border, grey background, centred text.
it('a button item drops the browser button look', () => {
const rule = /button\.uid-sidebar-item \{([^}]*)\}/.exec(sidebarCss)?.[1] ?? ''
Expand Down
2 changes: 1 addition & 1 deletion src/patterns/TopBar/UidTopBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
gap: var(--uid-space-sm);
align-items: center;
height: 56px;
height: var(--uid-shell-bar-height, 56px);
padding: 0 var(--uid-space-lg);
border-bottom: 1px solid var(--uid-border-subtle);
background: var(--uid-surface-raised);
Expand Down
2 changes: 2 additions & 0 deletions src/tokens/sizing.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
--uid-size-sm: 32px;
--uid-size-md: 40px;
--uid-size-lg: 48px;
/* The application shell's bars: the top bar and the sidebar's header share one line under them. */
--uid-shell-bar-height: 56px;
}
Loading