From 33f6429971e099e31b48cc84fe800d0875b81142 Mon Sep 17 00:00:00 2001 From: Denis Skripchenko Date: Wed, 18 Nov 2026 00:35:43 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20--uid-shell-bar-height=20=E2=80=94=20th?= =?UTF-8?q?e=20sidebar's=20header=20and=20the=20top=20bar=20share=20one=20?= =?UTF-8?q?line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The top bar was 56px with its line; the sidebar's header was as tall as its content plus 16px above and below, so the lines under the two missed each other by a pixel or several, differently in every app. Both now take --uid-shell-bar-height (56px): the top bar as its height, the header as its least height with the content centred, and the same subtle line. Co-Authored-By: Claude Opus 5.5 --- .changeset/shell-bar-line.md | 5 +++++ src/patterns/Sidebar/UidSidebar.css | 8 ++++++-- src/patterns/Sidebar/UidSidebar.spec.ts | 10 ++++++++++ src/patterns/TopBar/UidTopBar.css | 2 +- src/tokens/sizing.css | 2 ++ 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .changeset/shell-bar-line.md 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