Skip to content

Commit 8b38051

Browse files
committed
BlackLivesMatter
1 parent 2f640bc commit 8b38051

File tree

3 files changed

+230
-169
lines changed

3 files changed

+230
-169
lines changed

packages/docs/src/components/layout.js

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const sidebar = {
2121
a: NavLink,
2222
}
2323

24-
const getModeName = mode => {
24+
const getModeName = (mode) => {
2525
switch (mode) {
2626
case 'dark':
2727
return 'Dark'
@@ -36,16 +36,17 @@ const getModeName = mode => {
3636
}
3737
}
3838

39-
export default props => {
39+
export default (props) => {
4040
const [menuOpen, setMenuOpen] = useState(false)
4141
const nav = useRef(null)
4242
const [mode, setMode] = useColorMode()
4343
const fullwidth =
4444
(props.pageContext.frontmatter &&
4545
props.pageContext.frontmatter.fullwidth) ||
46-
props.location.pathname === '/'
46+
props.location.pathname === '/home'
47+
const showNav = !props.pageContext?.frontmatter?.hidenav
4748

48-
const cycleMode = e => {
49+
const cycleMode = (e) => {
4950
const i = modes.indexOf(mode)
5051
const next = modes[(i + 1) % modes.length]
5152
setMode(next)
@@ -60,40 +61,42 @@ export default props => {
6061
flexDirection: 'column',
6162
minHeight: '100vh',
6263
}}>
63-
<Flex
64-
as="header"
65-
sx={{
66-
height: 64,
67-
px: 3,
68-
alignItems: 'center',
69-
justifyContent: 'space-between',
70-
}}>
71-
<Flex sx={{ alignItems: 'center' }}>
72-
<MenuButton
73-
onClick={e => {
74-
setMenuOpen(!menuOpen)
75-
if (!nav.current) return
76-
const navLink = nav.current.querySelector('a')
77-
if (navLink) navLink.focus()
78-
}}
79-
/>
80-
<Link to="/" sx={{ variant: 'links.nav' }}>
81-
Theme UI
82-
</Link>
83-
</Flex>
84-
<Flex>
85-
<NavLink href="https://github.com/system-ui/theme-ui">
86-
GitHub
87-
</NavLink>
88-
<Button
89-
sx={{
90-
ml: 2,
91-
}}
92-
onClick={cycleMode}>
93-
{getModeName(mode)}
94-
</Button>
64+
{showNav && (
65+
<Flex
66+
as="header"
67+
sx={{
68+
height: 64,
69+
px: 3,
70+
alignItems: 'center',
71+
justifyContent: 'space-between',
72+
}}>
73+
<Flex sx={{ alignItems: 'center' }}>
74+
<MenuButton
75+
onClick={(e) => {
76+
setMenuOpen(!menuOpen)
77+
if (!nav.current) return
78+
const navLink = nav.current.querySelector('a')
79+
if (navLink) navLink.focus()
80+
}}
81+
/>
82+
<Link to="/" sx={{ variant: 'links.nav' }}>
83+
Theme UI
84+
</Link>
85+
</Flex>
86+
<Flex>
87+
<NavLink href="https://github.com/system-ui/theme-ui">
88+
GitHub
89+
</NavLink>
90+
<Button
91+
sx={{
92+
ml: 2,
93+
}}
94+
onClick={cycleMode}>
95+
{getModeName(mode)}
96+
</Button>
97+
</Flex>
9598
</Flex>
96-
</Flex>
99+
)}
97100
<Box
98101
sx={{
99102
flex: '1 1 auto',
@@ -104,13 +107,13 @@ export default props => {
104107
}}>
105108
<div
106109
ref={nav}
107-
onFocus={e => {
110+
onFocus={(e) => {
108111
setMenuOpen(true)
109112
}}
110-
onBlur={e => {
113+
onBlur={(e) => {
111114
setMenuOpen(false)
112115
}}
113-
onClick={e => {
116+
onClick={(e) => {
114117
setMenuOpen(false)
115118
}}>
116119
<Sidebar

packages/docs/src/pages/home.mdx

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
import { Container, Box, Button } from 'theme-ui'
2+
import { Banner, Tiles } from '..'
3+
import Testimonials from './testimonials'
4+
import Graph from '../components/graph'
5+
6+
<Banner>
7+
8+
<Graph />
9+
10+
# Theme UI: The Design Graph Framework
11+
12+
Theme UI is a library for creating themeable user interfaces based on constraint-based design principles.
13+
Build custom component libraries, design systems, web applications, Gatsby themes, and more
14+
with a flexible API for best-in-class developer ergonomics.
15+
16+
17+
[Documentation](/getting-started)
18+
[GitHub](https://github.com/system-ui/theme-ui)
19+
20+
![Stars][stars]
21+
![Build Status][]
22+
![Version][]
23+
![MIT License][]
24+
![bundle size badge][size]
25+
26+
</Banner>
27+
28+
<Container>
29+
30+
<Tiles columns={2}>
31+
32+
1. ## Create your theme
33+
34+
```javascript
35+
export default {
36+
colors: {
37+
text: '#000',
38+
background: '#fff',
39+
primary: 'tomato',
40+
},
41+
fonts: {
42+
body: 'system-ui, sans-serif',
43+
heading: '"Avenir Next", sans-serif',
44+
},
45+
}
46+
```
47+
48+
2. ## Style your UI
49+
50+
```jsx
51+
/** @jsx jsx */
52+
import { jsx } from 'theme-ui'
53+
export default props => (
54+
<h1
55+
sx={{
56+
color: 'primary',
57+
fontFamily: 'heading',
58+
}}>
59+
Hello
60+
</h1>
61+
)
62+
```
63+
64+
</Tiles>
65+
66+
<Tiles>
67+
68+
- ## Ergonomic
69+
Best-in-class developer ergonomics let you style
70+
your application quickly and consistently
71+
based on your theme
72+
- ## Themeable
73+
Quickly and easily reference values from your theme
74+
throughout your entire application, on any component
75+
- ## Constraint-based
76+
Use color, typography, and layout scales
77+
rooted in constraint-based design principles
78+
79+
</Tiles>
80+
81+
<Testimonials />
82+
83+
<Tiles
84+
sx={{
85+
fontWeight: 'bold',
86+
a: {
87+
display: 'block',
88+
color: 'inherit',
89+
textDecoration: 'none',
90+
':hover': {
91+
textDecoration: 'underline',
92+
}
93+
}
94+
}}>
95+
96+
- [Theme-aware `sx` prop for CSS](/getting-started/#sx-prop)
97+
- [30+ Built-in primitive UI components](/components)
98+
- [Simple, expressive MDX styling](/styling-mdx)
99+
- [Style with or without creating components](/getting-started/#sx-prop)
100+
- [Use Typography.js themes](/styling-mdx/#typographyjs)
101+
- [Easy, mobile-first responsive styles](/getting-started/#responsive-styles)
102+
- [Built-in dark mode](/color-modes)
103+
- [Plugin for Gatsby sites and themes](/packages/gatsby-plugin)
104+
- [Robust theming API](/theming)
105+
- [Backed with a Theme Specification](/theme-spec)
106+
107+
</Tiles>
108+
109+
<Box py={6}>
110+
111+
## Get Started
112+
113+
<Button
114+
as='a'
115+
href='/getting-started'
116+
variant='black'>
117+
Explore the Docs
118+
</Button>
119+
120+
</Box>
121+
122+
</Container>
123+
124+
[build status]: https://flat.badgen.net/github/status/system-ui/theme-ui
125+
[version]: https://flat.badgen.net/npm/v/theme-ui
126+
[npm]: https://npmjs.com/package/theme-ui
127+
[mit license]: https://flat.badgen.net/badge/license/MIT/blue
128+
[size]: https://flat.badgen.net/bundlephobia/minzip/theme-ui
129+
[stars]: https://flat.badgen.net/github/stars/system-ui/theme-ui

0 commit comments

Comments
 (0)