Skip to content

Commit 4bc6f43

Browse files
committed
Add new theme based on US Web Design Standards
1 parent 5657e0b commit 4bc6f43

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Noriega — a <a href='https://github.com/kyleamathews/typography.js'>Typography.js</a> theme
2+
3+
A theme for Typography.js
4+
5+
## Install
6+
```bash
7+
npm install --save typography typography-theme-noriega
8+
```
9+
## Usage
10+
```javascript
11+
import Typography from 'typography'
12+
import noriegaTheme from 'typography-theme-noriega'
13+
14+
const typography = new Typography(noriegaTheme)
15+
```
16+
## More on theme
17+
18+
Noriega uses "<a href='https://fonts.google.com/specimen/Lato'>Lato</a>" for headers and "<a href='https://fonts.google.com/specimen/Lato'>Lato</a>" for body text
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "typography-theme-us-web-design-standards",
3+
"description": "A theme for Typography.js inspired by the US Web Design Standaards https://standards.usa.gov/typography/",
4+
"version": "0.11.8",
5+
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
6+
"main": "./dist/index.js",
7+
"keywords": [
8+
"css",
9+
"typography",
10+
"typography-theme"
11+
],
12+
"license": "MIT",
13+
"scripts": {
14+
"build": "../../node_modules/.bin/babel src --out-dir dist/",
15+
"flow": "../../node_modules/.bin/flow",
16+
"lint": "../../node_modules/.bin/eslint --ext .js,.jsx --ignore-path .gitignore .",
17+
"watch": "../../node_modules/.bin/babel -w src --out-dir dist/"
18+
},
19+
"dependencies": {
20+
"gray-percentage": "^1.1.2"
21+
}
22+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// @flow
2+
import type { OptionsType } from 'Types'
3+
import gray from 'gray-percentage'
4+
5+
const theme: OptionsType = {
6+
title: 'US Web Design Standards',
7+
baseFontSize: '17px',
8+
baseLineHeight: '26px',
9+
modularScales: [
10+
{
11+
scale: 2.35,
12+
},
13+
{
14+
scale: 'minor seventh',
15+
maxWidth: '768px',
16+
},
17+
],
18+
googleFonts: [
19+
{
20+
name: 'Merriweather',
21+
styles: [
22+
'700',
23+
],
24+
},
25+
{
26+
name: 'Source Sans Pro',
27+
styles: [
28+
'400',
29+
'400i',
30+
'700',
31+
],
32+
},
33+
],
34+
headerFontFamily: ['Merriweather', 'serif'],
35+
bodyFontFamily: ['Source Sans Pro', 'sans-serif'],
36+
headerGray: 20,
37+
bodyGray: 20,
38+
headerWeight: 700,
39+
bodyWeight: 400,
40+
boldWeight: 700,
41+
overrideStyles: ({ adjustFontSizeTo, adjustFontSizeToMSValue, rhythm }, options) => ({
42+
h1: adjustFontSizeToMSValue(5/5),
43+
h2: adjustFontSizeToMSValue(3/5),
44+
h3: adjustFontSizeToMSValue(1/5),
45+
h4: adjustFontSizeToMSValue(0/5),
46+
h5: adjustFontSizeToMSValue(-1/8),
47+
h6: {
48+
...adjustFontSizeToMSValue(-2/8),
49+
fontFamily: options.bodyFontFamily.join(','),
50+
fontWeight: options.bodyWeight,
51+
textTransform: 'uppercase',
52+
},
53+
a: {
54+
color: '#0071bc',
55+
},
56+
'a:visited': {
57+
color: '#4c2c92',
58+
},
59+
blockquote: {
60+
...adjustFontSizeToMSValue(1/4),
61+
borderLeft: `${rhythm(1/6)} solid`,
62+
borderColor: gray(93),
63+
paddingTop: rhythm(1/3),
64+
paddingBottom: rhythm(1/3),
65+
paddingLeft: rhythm(2/3),
66+
paddingRight: rhythm(2/3),
67+
},
68+
'blockquote > :last-child': {
69+
marginBottom: 0,
70+
},
71+
'blockquote cite': {
72+
...adjustFontSizeTo(options.baseFontSize),
73+
color: gray(54, 204),
74+
fontWeight: options.bodyWeight,
75+
fontStyle: 'normal',
76+
},
77+
}),
78+
}
79+
80+
export default theme

0 commit comments

Comments
 (0)