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
25 changes: 21 additions & 4 deletions packages/docs/src/components/TypingWord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import { vars } from '@/theming/vars.stylex';
import * as stylex from '@stylexjs/stylex';
import { Fragment } from 'react';

const WORDS = [
'expressive',
Expand All @@ -20,11 +21,20 @@ const WORDS = [

export default function TypingWord() {
return (
<span {...stylex.props(styles.container)}>
<span {...stylex.props(styles.container)} aria-hidden="true">
{WORDS.map((word, index) => (
<span key={index} {...stylex.props(styles.word)}>
{word}
</span>
<Fragment key={word}>
<span {...stylex.props(styles.word)}>
{word}
<span {...stylex.props(styles.hidden)}>
{index < WORDS.length - 2
? ', '
: index === WORDS.length - 2
? ' and '
: ''}
</span>
</span>
</Fragment>
))}
</span>
);
Expand Down Expand Up @@ -114,4 +124,11 @@ const styles = stylex.create({
),
animationIterationCount: 'infinite',
},
hidden: {
position: 'absolute',
top: -9999,
left: -9999,
fontSize: '0.01em',
opacity: 0.0001,
},
});
18 changes: 12 additions & 6 deletions packages/docs/src/pages/(home)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,23 @@ import { vars } from '@/theming/vars.stylex';
export default function Home() {
return (
<>
<title>StyleX</title>
<link href="/img/favicon.svg" rel="icon" type="image/svg+xml" />
<title>StyleX — styling system for ambitious interfaces</title>
<main {...stylex.props(styles.main)}>
<section {...stylex.props(styles.hero)}>
<h1 {...stylex.props(styles.title)}>
<StylexAnimatedLogo style={styles.logo} />
</h1>
<p {...stylex.props(styles.subtitle)}>
The <TypingWord /> <br {...stylex.props(styles.mobileBreak)} />
styling system for <br {...stylex.props(styles.tabletBreak)} />{' '}
ambitious interfaces
<p
{...stylex.props(styles.subtitle)}
aria-label="The expressive, type-safe, composable, predictable, and themeable styling system for ambitious interfaces"
>
<span aria-hidden="true">
The <TypingWord />{' '}
<br {...stylex.props(styles.mobileBreak)} aria-hidden="true" />
styling system for{' '}
<br {...stylex.props(styles.tabletBreak)} aria-hidden="true" />
ambitious interfaces
</span>
</p>
<div {...stylex.props(styles.ctaSpacer)} />
<section {...stylex.props(styles.ctaSection)}>
Expand Down
1 change: 0 additions & 1 deletion packages/docs/src/pages/(playground)/playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function PlaygroundPage() {
return (
<>
<title>Playground | StyleX</title>
<link href="/img/favicon.svg" rel="icon" type="image/svg+xml" />
<main {...stylex.props(styles.main)}>
<Playground />
</main>
Expand Down
17 changes: 17 additions & 0 deletions packages/docs/src/pages/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,29 @@ import '@/styles/globals.css';
import DevStyleXHMR from '@/components/DevStyleXHMR';
import { SidebarProvider } from '@/contexts/SidebarContext';
import faviconUrl from '@/static/img/favicon.svg';
import coverImageUrl from '@/static/img/stylex-cover-photo.png';

const DEFAULT_TITLE = 'StyleX — The styling system for ambitious interfaces';
const DEFAULT_DESCRIPTION = 'The styling system that powers Meta.';

export default function RootLayout({ children }: { children: ReactNode }) {
return (
<>
<head>
<meta charSet="utf-8" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content={DEFAULT_DESCRIPTION} name="description" />
<meta content={DEFAULT_TITLE} property="og:title" />
<meta content={DEFAULT_DESCRIPTION} property="og:description" />
<meta content="website" property="og:type" />
<meta content={coverImageUrl} property="og:image" />
<meta content="summary_large_image" name="twitter:card" />
<meta content={DEFAULT_TITLE} name="twitter:title" />
<meta content={DEFAULT_DESCRIPTION} name="twitter:description" />
<meta content={coverImageUrl} name="twitter:image" />
<link href={faviconUrl} rel="icon" sizes="any" />
<link href={faviconUrl} rel="icon" type="image/svg+xml" />
<link href={faviconUrl} rel="shortcut icon" />
</head>
<DevStyleXHMR />
<Provider>
Expand Down
Loading