Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Reshuffle font sizes #1091

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
height: var(--accordion-panel-height);
overflow: hidden;
color: var(--color-gray-600);
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 1rem;
line-height: 1.5rem;
transition: height 150ms ease-out;

&[data-starting-style],
Expand All @@ -68,5 +68,5 @@
}

.Content {
padding-bottom: 0.5rem;
padding-bottom: 0.75rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default function ExampleAccordion() {
</Accordion.Header>
<Accordion.Panel className={styles.Panel}>
<div className={styles.Content}>
Base UI is a library of high-quality, accessible, unstyled React
components for design systems and web apps.
Base UI is a library of high-quality unstyled React components for design
systems and web apps.
</div>
</Accordion.Panel>
</Accordion.Item>
Expand All @@ -30,7 +30,7 @@ export default function ExampleAccordion() {
<Accordion.Panel className={styles.Panel}>
<div className={styles.Content}>
Head to the “Quick start” guide in the docs. If you’ve used unstyled
libraries before, you’ll feel right at home.
libraries before, you’ll feel at home.
</div>
</Accordion.Panel>
</Accordion.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export default function ExampleAccordion() {
<PlusIcon className="mr-2 size-3 transition-all ease-out group-data-[panel-open]:scale-110 group-data-[panel-open]:rotate-45" />
</Accordion.Trigger>
</Accordion.Header>
<Accordion.Panel className="h-[var(--accordion-panel-height)] overflow-hidden text-sm text-gray-600 transition-[height] ease-out [[data-starting-style],[data-ending-style]]:h-0">
<Accordion.Panel className="h-[var(--accordion-panel-height)] overflow-hidden text-base text-gray-600 transition-[height] ease-out [[data-starting-style],[data-ending-style]]:h-0">
<div className="pb-3">
Base UI is a library of high-quality, accessible, unstyled React
components for design systems and web apps.
Base UI is a library of high-quality unstyled React components for design
systems and web apps.
</div>
</Accordion.Panel>
</Accordion.Item>
Expand All @@ -26,10 +26,10 @@ export default function ExampleAccordion() {
<PlusIcon className="mr-2 size-3 transition-all ease-out group-data-[panel-open]:scale-110 group-data-[panel-open]:rotate-45" />
</Accordion.Trigger>
</Accordion.Header>
<Accordion.Panel className="h-[var(--accordion-panel-height)] overflow-hidden text-sm text-gray-600 transition-[height] ease-out [[data-starting-style],[data-ending-style]]:h-0">
<Accordion.Panel className="h-[var(--accordion-panel-height)] overflow-hidden text-base text-gray-600 transition-[height] ease-out [[data-starting-style],[data-ending-style]]:h-0">
<div className="pb-3">
Head to the “Quick start” guide in the docs. If you’ve used unstyled
libraries before, you’ll feel right at home.
libraries before, you’ll feel at home.
</div>
</Accordion.Panel>
</Accordion.Item>
Expand All @@ -41,7 +41,7 @@ export default function ExampleAccordion() {
<PlusIcon className="mr-2 size-3 transition-all ease-out group-data-[panel-open]:scale-110 group-data-[panel-open]:rotate-45" />
</Accordion.Trigger>
</Accordion.Header>
<Accordion.Panel className="h-[var(--accordion-panel-height)] overflow-hidden text-sm text-gray-600 transition-[height] ease-out [[data-starting-style],[data-ending-style]]:h-0">
<Accordion.Panel className="h-[var(--accordion-panel-height)] overflow-hidden text-base text-gray-600 transition-[height] ease-out [[data-starting-style],[data-ending-style]]:h-0">
<div className="pb-3">Of course! Base UI is free and open source.</div>
</Accordion.Panel>
</Accordion.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
background-color: var(--color-gray-100);
color: var(--color-gray-900);
font-family: inherit;
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;

@media (hover: hover) {
Expand Down Expand Up @@ -54,8 +54,8 @@
flex-direction: column;
justify-content: flex-end;
overflow: hidden;
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
transition: all 150ms ease-out;

&[data-starting-style],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
}

.Label {
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
color: var(--color-gray-900);
}
Expand All @@ -32,14 +32,14 @@
}

.Error {
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-red-800);
}

.Description {
margin: 0;
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-gray-600);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
}

.Label {
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
color: var(--color-gray-900);
}
Expand All @@ -51,14 +51,14 @@
}

.Error {
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-red-800);
}

.Description {
margin: 0;
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-gray-600);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}

.Label {
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
color: var(--color-gray-900);
}
Expand All @@ -38,8 +38,8 @@
}

.Error {
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-red-800);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
padding-left: 1rem;
padding-right: 2rem;
display: flex;
font-size: 0.9375rem;
font-size: 0.875rem;
line-height: 1rem;

&[data-highlighted] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

.Label {
cursor: ew-resize;
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
color: var(--color-gray-900);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@

.Summary {
margin: 0;
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-gray-900);
text-wrap: pretty;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
display: flex;
flex-direction: column;
gap: 1rem;
padding: 0.75rem 1.25rem;
padding-block: 0.75rem;
padding-left: 1rem;
padding-right: 1.5rem;
}

.Paragraph {
margin: 0;
font-size: 0.9375rem;
font-size: 0.875rem;
line-height: 1.375rem;
color: var(--color-gray-900);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export default function ExampleScrollArea() {
return (
<ScrollArea.Root className="h-[8.5rem] w-96 max-w-[calc(100vw-8rem)]">
<ScrollArea.Viewport className="h-full overscroll-contain rounded-md outline -outline-offset-1 outline-gray-200 focus-visible:outline-2 focus-visible:outline-blue-800">
<div className="flex flex-col gap-4 px-5 py-3">
<p className="text-sm text-gray-900">
<div className="flex flex-col gap-4 py-3 pr-6 pl-4 text-sm leading-[1.375rem] text-gray-900">
<p>
Vernacular architecture is building done outside any academic tradition,
and without professional guidance. It is not a particular architectural
movement or style, but rather a broad category, encompassing a wide range
Expand All @@ -17,7 +17,7 @@ export default function ExampleScrollArea() {
the small percentage of new buildings every year designed by architects
and built by engineers.
</p>
<p className="text-sm text-gray-900">
<p>
This type of architecture usually serves immediate, local needs, is
constrained by the materials available in its particular region and
reflects local traditions and cultural practices. The study of vernacular
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
.Item {
box-sizing: border-box;
outline: 0;
font-size: 0.9375rem;
font-size: 0.875rem;
line-height: 1rem;
padding-block: 0.5rem;
padding-left: 0.625rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
}

.Link {
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-gray-900);
text-decoration-color: var(--color-gray-400);
text-decoration-thickness: 1px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
appearance: none;
color: var(--color-gray-600);
font-family: inherit;
font-size: 0.8125rem;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
user-select: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ export default function ExampleScrollArea() {
<Tabs.Root className="rounded-md border border-gray-200" defaultValue="overview">
<Tabs.List className="relative z-0 flex gap-1 px-1 shadow-[inset_0_-1px] shadow-gray-200">
<Tabs.Tab
className="flex h-8 items-center justify-center border-0 px-2 text-xs font-medium text-gray-600 outline-0 select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline-2 data-[selected]:text-gray-900"
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium text-gray-600 outline-0 select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline-2 data-[selected]:text-gray-900"
value="overview"
>
Overview
</Tabs.Tab>
<Tabs.Tab
className="flex h-8 items-center justify-center border-0 px-2 text-xs font-medium text-gray-600 outline-0 select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline-2 data-[selected]:text-gray-900"
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium text-gray-600 outline-0 select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline-2 data-[selected]:text-gray-900"
value="projects"
>
Projects
</Tabs.Tab>
<Tabs.Tab
className="flex h-8 items-center justify-center border-0 px-2 text-xs font-medium text-gray-600 outline-0 select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline-2 data-[selected]:text-gray-900"
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium text-gray-600 outline-0 select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline-2 data-[selected]:text-gray-900"
value="account"
>
Account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

.Popup {
box-sizing: border-box;
font-size: 0.9375rem;
line-height: 1.375rem;
font-size: 0.875rem;
line-height: 1.25rem;
display: flex;
flex-direction: column;
padding: 0.25rem 0.5rem;
Expand Down
1 change: 1 addition & 0 deletions docs/src/components/CodeBlock.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
}

.CodeBlockPanelTitle {
@apply text-sm;
color: var(--color-foreground);
font-weight: 500;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Header.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@layer components {
.Header {
@apply text-sm;
@apply text-md;
position: absolute;
left: 0;
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function Header() {
<NpmIcon />
<span className="flex flex-grow-1 items-baseline justify-between">
npm package
<span className="text-sm text-gray-600">{VERSION}</span>
<span className="text-md text-gray-600">{VERSION}</span>
</span>
</MobileNav.Item>
<MobileNav.Item href="https://github.com/mui/base-ui" rel="noopener">
Expand Down
15 changes: 11 additions & 4 deletions docs/src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ import clsx from 'clsx';
import NextLink from 'next/link';
import { ExternalLinkIcon } from 'docs/src/components/icons/ExternalLinkIcon';

export function Link(props: React.ComponentProps<typeof NextLink>) {
if (typeof props.href === 'string' && props.href.startsWith('http')) {
export function Link({ href, className, ...props }: React.ComponentProps<typeof NextLink>) {
// Sometimes link come from component descriptions; in this case, remove the domain
if (typeof href === 'string' && href.startsWith('https://base-ui.com')) {
href = href.replace('https://base-ui.com', '');
}

if (typeof href === 'string' && href.startsWith('http')) {
return (
<NextLink
href={href}
target="_blank"
rel="noopener"
{...props}
className={clsx('Link inline-flex items-center gap-1', props.className)}
className={clsx('Link inline-flex items-center gap-1', className)}
>
{props.children}
<ExternalLinkIcon />
</NextLink>
);
}
return <NextLink {...props} className={clsx('Link', props.className)} />;

return <NextLink href={href} className={clsx('Link', className)} {...props} />;
}
2 changes: 1 addition & 1 deletion docs/src/components/Select.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}

@media (pointer: coarse) {
@apply text-sm;
@apply text-md;
height: 2.25rem;
grid-template-columns: 0.5rem 0.75rem 0.5rem auto 1.5rem;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/SideNav.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.SideNavRoot {
/* Match quick nav spacing so side nav and quick nav are visually aligned */
--side-nav-item-height: 2rem;
--side-nav-item-line-height: var(--text-sm--line-height);
--side-nav-item-line-height: var(--text-md--line-height);
--side-nav-item-padding-y: calc(
var(--side-nav-item-height) / 2 - var(--side-nav-item-line-height) / 2
);
Expand All @@ -16,7 +16,7 @@
var(--side-nav-scrollbar-thumb-width) / 2
);

@apply text-sm;
@apply text-md;
position: sticky;
top: 0;

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Table.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@layer components {
.TableRoot {
@apply text-xs;
@apply text-sm;
color: var(--color-gray);
border: 1px solid var(--color-gray-200);
border-collapse: separate;
Expand Down
Loading
Loading