Skip to content

Commit

Permalink
Merge pull request #18 from monicavarhale/prismTypography
Browse files Browse the repository at this point in the history
feat(typography): Add typography(colors, spacing, textSizes) to prism
  • Loading branch information
monicavarhale authored May 17, 2018
2 parents 18b1d23 + 097b453 commit 6bd6427
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 175 deletions.
3 changes: 2 additions & 1 deletion catalog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { Catalog } from "catalog";

import home from "./pages/home/index";
import colors from "./pages/colors/index";
import typography from "./pages/typography/index";
import buttons from "./pages/buttons/index";
import grid from "./pages/grid/index";
import icons from "./pages/icons/index";

const theme = {
pageHeadingBackground: "linear-gradient( 124deg, #009cde, #535eb2 )"
};
const pages = [home, colors, buttons, grid, icons];
const pages = [home, colors, typography, buttons, grid, icons];

const sizes = [
{ name: "mobile", width: 480 },
Expand Down
46 changes: 14 additions & 32 deletions catalog/pages/colors/index.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,41 @@
### Pacific
### Heliotrope

```color-palette|horizontal
colors: !import pacific
colors: !import heliotrope
```

### Sierra

```color-palette|horizontal
colors: !import sierra
```

### Cascade

```color-palette|horizontal
colors: !import cascade
```

### Rocky

```color-palette|horizontal
colors: !import rocky
```

### Ridge
### Cruz

```color-palette|horizontal
colors: !import ridge
colors: !import cruz
```

### Yosemite
### Alert

```color-palette|horizontal
colors: !import yosemite
colors: !import alert
```

### Helen
### Caution

```color-palette|horizontal
colors: !import helen
colors: !import caution
```

### Malibu
### positive

```color-palette|horizontal
colors: !import malibu
colors: !import positive
```

### Catalina
### Onyx

```color-palette|horizontal
colors: !import catalina
colors: !import onyx
```

### Cruz
### White

```color-palette|horizontal
colors: !import cruz
colors: !import white
```
2 changes: 1 addition & 1 deletion catalog/pages/grid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Container, Row, Column } from "../../../src/components/Grid";
import colors from "../../../src/theme/colors";

const contentStyles = {
backgroundColor: colors.pacific.base,
backgroundColor: colors.azure.base,
textAlign: "center"
};

Expand Down
2 changes: 1 addition & 1 deletion catalog/pages/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Container, Row, Column } from "../../../src/components/Grid";
import colors from "../../../src/theme/colors";

const iconStyle = {
backgroundColor: colors.white,
backgroundColor: colors.white.base,
padding: "20px",
display: "flex",
justifyContent: "center",
Expand Down
45 changes: 45 additions & 0 deletions catalog/pages/typography/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { pageLoader } from "catalog";

import { colors, typography } from "../../../src/theme";
import { Container, Row, Column } from "../../../src/components/Grid";

const textStyle = {
backgroundColor: colors.white.base,
padding: "20px",
display: "flex",
justifyContent: "center",
alignItems: "center",
fontSize: typography.size.bronto
};

const fontWeightLabelStyle = {
padding: "10px",
textAlign: "center"
};

const fontSizeRowStyle = {
padding: "20px",
display: "flex",
alignItems: "center"
};

const getFontWeightTextStyle = props => ({
...textStyle,
...props
});

export default {
path: "/typography",
title: "Typography",
imports: {
colors,
typography,
Container,
Row,
Column,
getFontWeightTextStyle,
fontWeightLabelStyle,
fontSizeRowStyle
},
content: pageLoader(() => import("./index.md"))
};
98 changes: 98 additions & 0 deletions catalog/pages/typography/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
### Font Weights

```react
<Container>
<Row>
<Column medium={3}>
<div style={getFontWeightTextStyle({fontWeight: typography.weight.light})}>Aa</div>
<div style={fontWeightLabelStyle}>Light</div>
</Column>
<Column medium={3}>
<div style={getFontWeightTextStyle({fontWeight: typography.weight.regular})}>Aa</div>
<div style={fontWeightLabelStyle}>Regular</div>
</Column>
<Column medium={3}>
<div style={getFontWeightTextStyle({fontWeight: typography.weight.semiBold})}>Aa</div>
<div style={fontWeightLabelStyle}>Semi Bold</div>
</Column>
<Column medium={3}>
<div style={getFontWeightTextStyle({fontWeight: typography.weight.extraBold})}>Aa</div>
<div style={fontWeightLabelStyle}>Extra Bold</div>
</Column>
</Row>
</Container>
```

### Font Sizes

```react
const str = "Better is together";
<Container>
<Row style={fontSizeRowStyle}>
<Column medium={2} >12 px</Column>
<Column medium={6} style={{fontSize: "12px"}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>14 px</Column>
<Column medium={6} style={{fontSize: "14px"}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>16 px</Column>
<Column medium={6} style={{fontSize: "16px"}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>20 px</Column>
<Column medium={6} style={{fontSize: "20px"}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>24 px</Column>
<Column medium={6} style={{fontSize: "24px"}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>32 px</Column>
<Column medium={6} style={{fontSize: "32px"}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>46 px</Column>
<Column medium={6} style={{fontSize: "42px"}}>{str}</Column>
</Row>
</Container>
```

### Text Variations

```react
const str = "Better is together";
<Container>
<Row style={fontSizeRowStyle}>
<Column medium={2} >Primary</Column>
<Column medium={6} style={{color: colors.onyx.base}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>Seconday</Column>
<Column medium={6} style={{color: colors.onyx.light}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>Disabled</Column>
<Column medium={6} style={{color: colors.onyx.muted}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>Alert</Column>
<Column medium={6} style={{color: colors.alert.base}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>Caution</Column>
<Column medium={6} style={{color: colors.caution.base}}>{str}</Column>
</Row>
<Row style={fontSizeRowStyle}>
<Column medium={2}>Affirming</Column>
<Column medium={6} style={{color: colors.positive.base}}>{str}</Column>
</Row>
</Container>
```
Loading

0 comments on commit 6bd6427

Please sign in to comment.