Skip to content

Commit 81a5b23

Browse files
Merge pull request #55 from arcticicestudio/feature/gh-54-typefaces
Typefaces
2 parents a2a3a50 + b8ed6ae commit 81a5b23

File tree

4 files changed

+113
-5
lines changed

4 files changed

+113
-5
lines changed

package-lock.json

+27-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,13 @@
8787
"gatsby-plugin-remove-trailing-slashes": "2.0.5",
8888
"gatsby-source-filesystem": "2.0.9",
8989
"gatsby-transformer-yaml": "2.1.5",
90+
"inter-ui": "3.0.0",
9091
"nord": ">=0.2.1 <1.0.0",
9192
"prop-types": "15.6.2",
9293
"react": "16.6.3",
9394
"react-dom": "16.6.3",
94-
"react-helmet": "5.2.0"
95+
"react-helmet": "5.2.0",
96+
"typeface-rubik": "0.0.54",
97+
"typeface-source-code-pro": "0.0.54"
9598
}
9699
}

src/styles/theme/index.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2018-present Sven Greb <[email protected]>
4+
*
5+
* Project: Nord Docs
6+
* Repository: https://github.com/arcticicestudio/nord-docs
7+
* License: MIT
8+
*/
9+
10+
/**
11+
* @file The global theme.
12+
* @author Arctic Ice Studio <[email protected]>
13+
* @author Sven Greb <[email protected]>
14+
* @since 0.2.0
15+
*/
16+
17+
import typography from "./typography";
18+
19+
const theme = { typography };
20+
21+
export { typography };
22+
23+
export default theme;

src/styles/theme/typography.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2018-present Sven Greb <[email protected]>
4+
*
5+
* Project: Nord Docs
6+
* Repository: https://github.com/arcticicestudio/nord-docs
7+
* License: MIT
8+
*/
9+
10+
/**
11+
* @file Typefaces and font styles.
12+
* @author Arctic Ice Studio <[email protected]>
13+
* @author Sven Greb <[email protected]>
14+
* @since 0.2.0
15+
*/
16+
17+
/**
18+
* All available typefaces for different usage scopes.
19+
*
20+
* - `main` - The stylistic and visualization typeface used for as root (`<html>`) font family for all site elements.
21+
* - `straight` - The factual and clear typeface for technical content and documentations.
22+
* - `monospace` - The main monospaced font for all code related site elements.
23+
*
24+
* @type {object}
25+
* @see https://fonts.google.com/specimen/Rubik
26+
* @see https://rsms.me/inter
27+
* @see https://fonts.google.com/specimen/Source+Code+Pro
28+
*/
29+
const typefaces = {
30+
main: "Rubik",
31+
straight: "Inter UI",
32+
straightVariable: "Inter UI var",
33+
monospace: "Source Code Pro"
34+
};
35+
36+
/**
37+
* The sizes based on the named "modular scale" ratio `1.125` (8:9 "major second"). Only one base is used with a value
38+
* of `1` for the `em` unit.
39+
*
40+
* @see https://www.modularscale.com/?1&em&1.125
41+
* @see https://polished.js.org/docs/#modularscale
42+
*
43+
* @type {object}
44+
*/
45+
const sizes = {
46+
msBase: 1,
47+
msBaseUnit: "em",
48+
msRatio: 1.125,
49+
root: 16,
50+
rootUnit: "px",
51+
weight: 400
52+
};
53+
54+
const typography = {
55+
sizes,
56+
typefaces
57+
};
58+
59+
export default typography;

0 commit comments

Comments
 (0)