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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ identity.

`logo` and `byline` are optional. The logo draws before the title and the
byline after it, in the muted color and a step smaller, inside the same link to
`href`. The byline hides below 640px. Left out, the bar shows only the title.
`href`. The byline shows on phones too and hides only below 340px. Left out, the bar shows only the title.

The pills in the middle of the bar show from 1024px. Below that width the
sections are reachable another way:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@withmarfa/docs-kit",
"version": "0.0.1-alpha.6",
"version": "0.0.1-alpha.7",
"description": "The shared look and plumbing of WithMarfa's documentation sites: Fumadocs layout, components, styles, agent surfaces and search.",
"license": "Apache-2.0",
"type": "module",
Expand Down
5 changes: 3 additions & 2 deletions src/components/site-header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ describe('the name in the top bar', () => {
expect(container.querySelectorAll('a')).toHaveLength(1);
});

it('mutes the byline, sets it a step smaller and hides it below 640px', () => {
it('mutes the byline, sets it a step smaller and hides it only on the narrowest phones', () => {
render(<HeaderBar title="Example" href="/" byline="by Acme" actions={null} />);
const byline = [...home().children].find((child) => child.textContent === 'by Acme')!;
expect(byline.className).toContain('text-fd-muted-foreground');
expect(byline.className).toContain('text-[0.8125rem]');
expect(byline.className).toContain('max-sm:hidden');
expect(byline.className).toContain('max-[340px]:hidden');
expect(byline.className).not.toContain('max-sm:hidden');
});

it('takes a logo without a byline', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function HeaderBar({
href: string;
/** Drawn before the title, inside the same link. */
logo?: ReactNode;
/** Drawn after the title, quieter and a step smaller. It hides below 640px, where the bar needs the room. */
/** Drawn after the title, quieter and a step smaller. It hides only below 340px, where the bar needs the room. */
byline?: string;
center?: ReactNode;
actions: ReactNode;
Expand All @@ -90,7 +90,7 @@ export function HeaderBar({
{logo}
{logo || byline ? <span>{title}</span> : title}
{byline ? (
<span className="text-[0.8125rem] font-normal tracking-normal text-fd-muted-foreground max-sm:hidden">
<span className="text-[0.8125rem] font-normal tracking-normal text-fd-muted-foreground max-[340px]:hidden">
{byline}
</span>
) : null}
Expand Down
Loading