Skip to content

Commit 7080845

Browse files
Added BlockQuote, updated fonts
1 parent 2b1e368 commit 7080845

13 files changed

Lines changed: 72 additions & 20 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
```js
2+
<BlockQuote>
3+
vx is collection of reusable low-level visualization components.
4+
</BlockQuote>
5+
```

src/components/BlockQuote/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import PropTypes from 'prop-types';
2+
import styled from 'react-emotion';
3+
import withTheme from '../ThemeContext/withTheme';
4+
5+
const BlockQuote = styled('blockquote')({
6+
padding: '8px 16px',
7+
lineHeight: 1.8,
8+
color: '#777777',
9+
borderLeft: '2px solid #EFEFEF'
10+
}, ({ theme }) => ({
11+
fontFamily: theme.fontFamily,
12+
fontSize: theme.fontSize
13+
}));
14+
15+
BlockQuote.propTypes = {
16+
theme: PropTypes.object.isRequired
17+
};
18+
19+
export default withTheme(BlockQuote);

src/components/Button/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ const Button = styled('button')({
3030
backgroundColor: color
3131
});
3232

33-
styles.push({ fontFamily: bold ? theme.titleFontFamily : theme.fontFamily });
34-
35-
styles.push({ fontWeight: bold ? 800 : 700 });
33+
styles.push({
34+
fontFamily: bold ? theme.titleFontFamily : theme.fontFamily,
35+
fontSize: theme.fontSize,
36+
fontWeight: bold ? 800 : 700
37+
});
3638

3739
if (bold) styles.push({
3840
lineHeight: 1.8,

src/components/Card/CardContent/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import withTheme from '../../ThemeContext/withTheme';
55
const CardContent = styled('div')({
66
lineHeight: 1.8
77
}, ({ theme }) => ({
8-
fontFamily: theme.fontFamily
8+
fontFamily: theme.fontFamily,
9+
fontSize: theme.fontSize
910
}));
1011

1112
CardContent.propTypes = {

src/components/Card/CardTitle/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import withTheme from '../../ThemeContext/withTheme';
44

55
const CardTitle = styled('h3')({
66
marginTop: 0,
7-
marginBottom: 12
7+
marginBottom: 8
88
}, ({ theme }) => ({
99
color: theme.primaryColor,
10-
fontFamily: theme.fontFamily
10+
fontFamily: theme.fontFamily,
11+
fontSize: theme.fontSize * 1.1
1112
}));
1213

1314
CardTitle.propTypes = {

src/components/Card/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const Card = styled('article')({
1010
color: black,
1111
backgroundColor: cardGrey
1212
}, ({ theme }) => ({
13-
fontFamily: theme.fontFamily
13+
fontFamily: theme.fontFamily,
14+
fontSize: theme.fontSize
1415
}));
1516

1617
Card.propTypes = {

src/components/Link/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const generateLink = (Component) => {
1616
}
1717
}, ({ theme }) => ({
1818
color: theme.primaryColor,
19-
fontFamily: theme.fontFamily
19+
fontFamily: theme.fontFamily,
20+
fontSize: theme.fontSize
2021
}));
2122

2223
Styled.propTypes = {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
```js
2+
<FontProvider>
3+
The correct font is available here!
4+
</FontProvider>
5+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import PropTypes from 'prop-types';
2+
import styled from 'react-emotion';
3+
import withTheme from '../../withTheme';
4+
5+
const FontProvider = styled('div')(({ theme }) => ({
6+
fontFamily: theme.fontFamily,
7+
fontSize: theme.fontSize
8+
}));
9+
10+
FontProvider.propTypes = {
11+
theme: PropTypes.object.isRequired
12+
};
13+
14+
export default withTheme(FontProvider);

src/components/ThemeContext/VxThemeProvider/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This component sets the ThemeContext which is used by other components. Its use is not obligatory, but if you do use it, use it at the top level of your app.
44
<br />
55
<br />
6-
It also sets the <Code>font-family</Code>, thus rendering <Code>font.css</Code> useless.
6+
It also sets the <Code>font-family</Code> and <Code>font-size</Code>, thus rendering <Code>font.css</Code> useless.
77
</VxThemeProvider>
88
```

0 commit comments

Comments
 (0)