Skip to content

Commit 67cf855

Browse files
authored
Merge pull request #6 from component-driven/fixes
Fixes for the theme
2 parents ba09916 + 0b9a00f commit 67cf855

File tree

7 files changed

+95
-45
lines changed

7 files changed

+95
-45
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
/public

slides/example.mdx

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,52 @@ This is paragraph with `inline` code
5959

6060
---
6161

62+
<Grid columns={3} gap={4}>
63+
<Box>
64+
65+
### OSS
66+
67+
<small>ex. Material UI, Ant Design, Bootstrap</small>
68+
69+
</Box>
70+
<Box>
71+
72+
### Mix
73+
74+
<small>
75+
Re-export or wrap components from OSS (Reakit, Theme-UI, Chakra, etc.)
76+
</small>
77+
78+
</Box>
79+
<Box>
80+
81+
### Custom
82+
83+
<small>Build everything from scratch (using styled-system, etc.)</small>
84+
85+
</Box>
86+
</Grid>
87+
88+
---
89+
90+
<Figure
91+
src={'/assets/chakra.png'}
92+
alt="Chakra UI Homepage"
93+
caption={<a href="https://chakra-ui.com">https://chakra-ui.com</a>}
94+
/>
95+
96+
---
97+
98+
<Figure
99+
src={"/assets/component-driven.svg"}
100+
alt="Component-driven Logo"
101+
caption={
102+
<a href="https://component-driven.io">https://component-driven.io</a>
103+
}
104+
/>
105+
106+
---
107+
62108
<Image src={"/assets/colorsnapper.png"} size="contain" />
63109

64110
---
@@ -115,12 +161,3 @@ function Code({ children, language, inline = false }) {
115161

116162
<Demo src="https://component-driven.io" />
117163

118-
---
119-
120-
<Figure
121-
src={"/assets/component-driven.svg"}
122-
alt="Component-driven Logo"
123-
caption={
124-
<a href="https://component-driven.io">https://component-driven.io</a>
125-
}
126-
/>

src/components/Figure.jsx

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
/** @jsx jsx */
22
import * as React from "react";
33
import PropTypes from "prop-types";
4-
import { jsx, Text, Flex, Grid, Image } from "theme-ui";
4+
import {jsx, Flex, Image, Text} from "theme-ui";
55

66
function Figure({ src, alt, caption, ...props }) {
7-
return (
8-
<Flex
9-
as="figure"
10-
gap={4}
11-
{...props}
12-
sx={{
13-
p: 5,
14-
flexDirection: "column",
15-
justifyItems: "center",
16-
maxHeight: "100%",
17-
}}
18-
>
19-
<Image
20-
src={src}
21-
alt={alt}
22-
sx={{
23-
display: "block",
24-
flexShrink: 1,
25-
maxHeight: "100%",
26-
}}
27-
/>
28-
{caption && (
29-
<Text
30-
as="figcaption"
31-
variant="styles.figcaption"
32-
sx={{ flexShrink: 0, my: 4 }}
33-
>
34-
{caption}
35-
</Text>
36-
)}
37-
</Flex>
38-
);
7+
return (
8+
<Flex
9+
as="figure"
10+
gap={4}
11+
{...props}
12+
sx={{
13+
flexDirection: "column",
14+
justifyItems: "center",
15+
justifyContent: "center",
16+
width: "100%",
17+
height: "100%",
18+
}}
19+
>
20+
<Flex
21+
sx={{
22+
flexGrow: 1,
23+
maxHeight: "90%",
24+
justifyContent: "center",
25+
}}
26+
>
27+
<Image src={src} alt={alt} sx={{ objectFit: "scale-down" }} />
28+
</Flex>
29+
{caption && (
30+
<Text as="figcaption" variant="styles.figcaption" sx={{ mt: 4 }}>
31+
{caption}
32+
</Text>
33+
)}
34+
</Flex>
35+
);
3936
}
4037

4138
Figure.propTypes = {

src/layouts/AnimatedGradient.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const animation = keyframes`
1717

1818
export default styled(Invert)(
1919
css((theme) => ({
20+
position: "absolute",
21+
width: "100vw",
22+
height: "100vh",
2023
background: `linear-gradient(270deg, ${theme.colors.primary}, ${theme.colors.accent})`,
2124
backgroundSize: "400% 400%",
2225
animation: `${animation} 10s infinite`,

src/layouts/Primary.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import React from "react";
2-
import {Invert} from "mdx-deck";
2+
import { Box } from "theme-ui";
3+
import { Invert } from "mdx-deck";
34

45
export default ({ children, imgSrc, sx, ...props }) => (
56
<Invert
67
sx={{
8+
position: "absolute",
9+
width: "100vw",
10+
height: "100vh",
711
backgroundColor: "primary",
812
backgroundSize: "cover",
913
backgroundImage: `url(${imgSrc})`,
@@ -13,6 +17,6 @@ export default ({ children, imgSrc, sx, ...props }) => (
1317
}}
1418
{...props}
1519
>
16-
{children}
20+
<Box sx={{ m: -5, p: 5 }}>{children}</Box>
1721
</Invert>
1822
);

src/layouts/Secondary.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import React from "react";
22
import {Invert} from "mdx-deck";
33

44
export default ({children, imgSrc, sx,...props}) => <Invert sx={{
5+
position: "absolute",
6+
width: "100vw",
7+
height: "100vh",
58
backgroundColor: "secondary",
69
backgroundSize: "cover",
710
backgroundImage: `url(${imgSrc})`,

src/theme.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export default {
22
aspectRatio: 9 / 16,
33
googleFont: "https://www.monolisa.dev/static/fonts.css",
4+
space: [0, "0.25rem", "0.5rem", "1rem", "2rem", "4rem"],
45
fonts: {
56
body: "MonoLisa, sans-serif",
67
heading: "MonoLisa, sans-serif",
@@ -53,7 +54,7 @@ export default {
5354
root: {
5455
m: 0,
5556
bg: "background",
56-
fontSize: "2.5vmax", // Make the typograpy respond to window size
57+
fontSize: "2vmax", // Make the typography respond to window size
5758
fontFamily: "body",
5859
fontWeight: "body",
5960
fontFeatureSettings: `'kern', 'pnum', common-ligatures contextual historical-ligatures`,
@@ -65,6 +66,9 @@ export default {
6566
fontFamily: "monospace",
6667
},
6768
},
69+
Slide: {
70+
p: 5,
71+
},
6872
Split: {
6973
px: 5,
7074
width: "100%",

0 commit comments

Comments
 (0)