Skip to content

Commit b8ed6ae

Browse files
Implement basic typography theme properties and values
In order to use the fonts is must be added to Nord Docs theme. This commit implements the `typography` module that defines all used font families and the basic typography properties and values like the font size and units based on the used modular scale documented in GH-2. Associated epic: GH-2 Dependency of GH-53 GH-54
1 parent 279b30a commit b8ed6ae

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

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)