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] Use the new logo #750

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 9 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
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ module.exports = {
},
],
'@typescript-eslint/no-redeclare': 'off',

// We LOVE non-breaking spaces here
'no-irregular-whitespace': 'off',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't setting { skipJSXText: true, skipStrings: true } be enough?

},
overrides: [
...baseline.overrides.filter(
Expand Down
Binary file added docs/public/static/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/static/favicon-dev.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/public/static/favicon-dev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/static/favicon-safari.ico
Binary file not shown.
Binary file modified docs/public/static/favicon.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/public/static/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/public/static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 0 additions & 34 deletions docs/public/static/manifest.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { AppBar } from 'docs/src/components/AppBar';
import { Navigation } from 'docs/src/components/Navigation';
import routes from 'docs/data/pages';
import '../../styles/style.css';
import 'docs/src/styles/style.css';

export default function Layout({ children }: React.PropsWithChildren<{}>) {
return (
Expand Down
16 changes: 16 additions & 0 deletions docs/src/app/(content)/getting-started/[slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as React from 'react';

import { AppBar } from 'docs/src/components/AppBar';
import { Navigation } from 'docs/src/components/Navigation';
import routes from 'docs/data/pages';
import 'docs/src/styles/style.css';

export default function Layout({ children }: React.PropsWithChildren<{}>) {
return (
<React.Fragment>
<AppBar />
<Navigation routes={routes} />
{children}
</React.Fragment>
);
}
16 changes: 16 additions & 0 deletions docs/src/app/(content)/guides/[slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as React from 'react';

import { AppBar } from 'docs/src/components/AppBar';
import { Navigation } from 'docs/src/components/Navigation';
import routes from 'docs/data/pages';
import 'docs/src/styles/style.css';

export default function Layout({ children }: React.PropsWithChildren<{}>) {
return (
<React.Fragment>
<AppBar />
<Navigation routes={routes} />
{children}
</React.Fragment>
);
}
16 changes: 16 additions & 0 deletions docs/src/app/(new)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as React from 'react';
import 'docs/src/styles.css';

export default function RootLayout({ children }: React.PropsWithChildren) {
return (
<div className="relative z-0 px-[round(min(3rem,max(2rem,5vw)),1px)]">
<span className="bg-color-gridline absolute left-0 right-0 top-12 -mt-px h-px" />
<span className="bg-color-gridline absolute bottom-12 left-0 right-0 -mb-px h-px" />
<div className="relative mx-auto flex min-h-dvh max-w-[1330px] flex-col py-12">
<span className="bg-color-gridline absolute bottom-0 left-0 top-0 -ml-px w-px" />
<span className="bg-color-gridline absolute bottom-0 right-0 top-0 -mr-px w-px" />
<div className="bg-color-content flex grow flex-col">{children}</div>
</div>
</div>
);
}
4 changes: 4 additions & 0 deletions docs/src/app/(new)/page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.LogoPattern {
/* Colm’s space */
/* background: fancy-gradient() */
}
79 changes: 79 additions & 0 deletions docs/src/app/(new)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import * as React from 'react';
import { Metadata } from 'next/types';
import { readFile } from 'node:fs/promises';
import './page.css';

const description =
'Unstyled React components for building accessible user interfaces.';

export default async function Page() {
const logo = await readFile('public/static/logo.svg', 'utf-8');
return (
<div className="relative flex grow flex-col justify-between gap-10 lg:justify-center [@media(min-height:700px)]:justify-center">
<div className="flex px-7 pt-7 md:px-16 md:pt-14 lg:items-center lg:pb-[min(10rem,max(3.5rem,10vh))]">
<div className="max-w-[26rem] 2xl:max-w-[40rem]">
<h1 className="mb-2 text-balance text-2xl font-medium 2xl:mb-3 2xl:text-3xl">
{description}
</h1>
<p className="text-color-gray mb-4 text-pretty 2xl:text-lg">
From the creators of Radix, Floating UI, and MUI.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
From the creators of Radix, Floating UI, and MUI.
From the creators of Radix, Floating UI, and Material UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colmtuite thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladmoroz It will be MUI next year, but yeah it should be "Material UI" for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladmoroz It will be MUI next year, but yeah it should be "Material UI" for now.

Looks like I also don't understand the difference between MUI and Material UI 🫠
How come it will change next year? Material UI library will be renamed to MUI?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current state:
MUI - the company
Material UI - the library

Who knows what the future will bring ;)

</p>
<div className="flex">
<span className="text-color-gray border-color-border -ml-[px] relative cursor-default select-none rounded-full border px-1.5 pb-[2px] pt-[1.5px] text-xs">
Coming soon
</span>
</div>
</div>
</div>

<div className="mb-10 lg:hidden">
<div
className="LogoPattern"
style={{
height: 70,
background: 'var(--color-gridline)',
maskImage: `url("data:image/svg+xml;utf8,${encodeURI(logo)}")`,
maskSize: '280px 70px',
maskPosition: '50%',
}}
/>
<div
className="LogoPattern"
style={{
height: 70,
background: 'var(--color-gridline)',
maskImage: `url("data:image/svg+xml;utf8,${encodeURI(logo)}")`,
maskSize: '280px 70px',
maskPosition: 'calc(50% - 140px)',
}}
/>
</div>

<div
className="LogoPattern hidden lg:block"
style={{
position: 'absolute',
top: 0,
bottom: 0,
right: '5rem',
width: 280,
background: 'var(--color-gridline)',
maskImage: `url("data:image/svg+xml;utf8,${encodeURI(logo)}")`,
maskSize: '280px 70px',
maskPosition: '0 -52px',
maskRepeat: 'repeat-y',
}}
/>
</div>
);
}

export const metadata: Metadata = {
description,
twitter: {
description,
},
openGraph: {
description,
},
};
26 changes: 26 additions & 0 deletions docs/src/app/Favicons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client';
import * as React from 'react';

export function Favicons() {
return (
<React.Fragment>
{/* Separate set of favicons in dev so that the dev tabs are easier to spot */}
{process.env.NODE_ENV !== 'production' && (
<React.Fragment>
<link rel="icon" href="/static/favicon-dev.ico" sizes="32x32" />
<link rel="icon" href="/static/favicon-dev.svg" type="image/svg+xml" />
</React.Fragment>
)}

{process.env.NODE_ENV === 'production' && (
<React.Fragment>
{/* Safari gets a different favicon because it messes up the original one in dark mode */}
<link rel="icon" href="/static/favicon-safari.ico" sizes="32x32" />
<link rel="icon" href="/static/favicon.svg" type="image/svg+xml" />
</React.Fragment>
)}

<link rel="apple-touch-icon" href="/static/apple-touch-icon.png" />
</React.Fragment>
);
}
2 changes: 1 addition & 1 deletion docs/src/app/experiments/experiments.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

a {
text-decoration: none;
color: var(--color-text);
color: var(--color-foreground);
margin: 0.5rem;

&:hover {
Expand Down
29 changes: 16 additions & 13 deletions docs/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import * as React from 'react';
import { Metadata } from 'next';
import { GoogleAnalytics } from 'docs/src/components/GoogleAnalytics';
import * as React from 'react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a convention to import React first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I add an ES lint rule to do import order so that it's fixed automatically then? I agree with the convention, I did similar for Radix Themes with a couple other ordering rules in the mix, just don't think a human should waste time doing it manually

Copy link
Member

@michaldudak michaldudak Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!
I vaguely recall we had one in Material UI, so I don't know why it doesn't work her (but perhaps I'm hallucinating)

import { DocsProviders } from './DocsProviders';
import { Favicons } from './Favicons';
import { GoogleAnalytics } from '../components/GoogleAnalytics';

interface Props {
children: React.ReactNode;
}

export default function Layout({ children }: Props) {
export default function Layout({ children }: React.PropsWithChildren) {
return (
<html lang="en">
<head>
<meta name="viewport" content="initial-scale=1, width=device-width" />
<link rel="manifest" href="/static/manifest.json" />
<link rel="shortcut icon" href="/static/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/static/icons/180x180.png"
<Favicons />

{/* iOS header background */}
<meta
name="theme-color"
content="oklch(98% 0.25% 264)"
media="(prefers-color-scheme: light)"
/>
<meta
name="theme-color"
content="oklch(0% 0% 0)"
media="(prefers-color-scheme: dark)"
/>
</head>
<body>
Expand Down
10 changes: 0 additions & 10 deletions docs/src/app/new/page.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/app/new/styles.css

This file was deleted.

49 changes: 0 additions & 49 deletions docs/src/app/page.tsx

This file was deleted.

7 changes: 5 additions & 2 deletions docs/src/components/AppBar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
background-color: rgba(255, 255, 255, 0.5);
background-clip: padding-box;
backdrop-filter: blur(4.25px) saturate(125%);
padding: var(--space-1) var(--space-3);
padding-top: var(--space-1);
padding-bottom: var(--space-1);
padding-left: var(--space-6);
padding-right: var(--space-3);
border-bottom: 1px solid var(--gray-outline-1);
display: flex;
justify-content: space-between;
Expand All @@ -17,7 +20,7 @@
.primary {
display: flex;
align-items: center;
gap: var(--space-2);
gap: var(--space-4);
}

.secondary {
Expand Down
9 changes: 5 additions & 4 deletions docs/src/components/AppBar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import * as React from 'react';
import { BaseUIIcon } from 'docs/src/icons/BaseUI';
import { GitHubIcon } from 'docs/src/icons/GitHub';
import { SettingsIcon } from 'docs/src/icons/Settings';
import { IconButton } from 'docs/src/design-system/IconButton';
import { IconLinkButton } from 'docs/src/design-system/IconLinkButton';
import NextLink from 'next/link';
import { DocsVersionSelector } from './DocsVersionSelector';
import packageJson from '../../../package.json';
import classes from './AppBar.module.css';
import { Logo } from './Logo';

const currentVersion = packageJson.version;
const supportedVersions = [
Expand All @@ -24,9 +25,9 @@ export function AppBar() {
return (
<header className={classes.root}>
<div className={classes.primary}>
<IconLinkButton useNextLink href="/" label="Base UI" size={3}>
<BaseUIIcon />
</IconLinkButton>
<NextLink href="/" className="-m-3 block p-3">
<Logo aria-label="Base UI" />
</NextLink>
<DocsVersionSelector currentVersion={currentVersion} versions={supportedVersions} />
</div>
<div className={classes.secondary}>
Expand Down
Loading