diff --git a/.changeset/shell-bar-line.md b/.changeset/shell-bar-line.md new file mode 100644 index 0000000..afe155e --- /dev/null +++ b/.changeset/shell-bar-line.md @@ -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. diff --git a/src/patterns/Sidebar/UidSidebar.css b/src/patterns/Sidebar/UidSidebar.css index 06a0740..06dd786 100644 --- a/src/patterns/Sidebar/UidSidebar.css +++ b/src/patterns/Sidebar/UidSidebar.css @@ -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; } diff --git a/src/patterns/Sidebar/UidSidebar.spec.ts b/src/patterns/Sidebar/UidSidebar.spec.ts index 76237aa..2d0e654 100644 --- a/src/patterns/Sidebar/UidSidebar.spec.ts +++ b/src/patterns/Sidebar/UidSidebar.spec.ts @@ -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