-
Notifications
You must be signed in to change notification settings - Fork 2
/
customize.html
152 lines (152 loc) · 6.15 KB
/
customize.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Customize | Typesettings.css</title>
<link rel="stylesheet" href="src/styles/typesettings.css">
<style>
@import url('https://fonts.googleapis.com/css?family=Bungee|Coda:400,800&display=swap');
:root {
--ts-color-heading: mediumvioletred;
--ts-color-body: navy;
--ts-color-link: mediumblue;
--ts-color-background: azure;
--ts-color-muted: darkcyan;
--ts-color-subtle: lightcyan;
--ts-font-family-sans: 'Bungee', sans-serif;
--ts-font-family-sans-alt: 'Coda', sans-serif;
--ts-font-weight-regular: 400;
}
</style>
<meta name="description" content="Cusztomizing Typesettings.css with data attributes and CSS custom properties.">
</head>
<body>
<a href="#content">
Skip to content
</a>
<div data-typesettings="golden">
<nav>
<ul>
<li>
<h1>
<a href="index.html">Typesettings.css</a> » <a href="customize.html" aria-current="page">Customize</a>
</h1>
</li>
<li>
<ul>
<li>
<a href="https://mikemai.net/typesettings/css/typesettings-2.0-min.css" aria-label="Download the Typesettings.css file">Download</a>
</li>
</ul>
</li>
</ul>
</nav>
<main id="content">
<article>
<header>
<h1 role="presentation">
Easy Customization
</h1>
<h2>
Data attribute & <abbr aria-label="Cascading Stylesheet">CSS</abbr> custom properties
</h2>
</header>
<section aria-labelledby="data-typesettings">
<h3 id="data-typesettings">
data-typesettings
</h3>
<p>
There are various values you can pass to the <code>data-typesettings</code> attribute. Mix and match for the desired design effects.
</p>
<pre><code><div data-typesettings="sans-serif indented golden vertical-rl dark"><br> …<br></div></code></pre>
<figure>
<table>
<thead>
<tr>
<th>Modifier</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>sans-serif</th>
<td>Sets the body text to sans-serif and heading text to serif.</td>
</tr>
<tr>
<th>indented</th>
<td>Uses paragraph indents instead of paragraph spacing.</td>
</tr>
<tr>
<th>golden</th>
<td>Turns on the golden ratio between article width and white space and sets the optimal character count per line.</td>
</tr>
<tr>
<th>vertical-rl</th>
<td>Allows content to flow right to left vertically. <a href="showcase-noto.html">See an example</a> »</td>
</tr>
<tr>
<th>dark</th>
<td>Applies a dark theme to the content.</td>
</tr>
</tbody>
</table>
</figure>
</section>
<hr>
<section aria-labelledby="props">
<h3 id="props">
Props
</h3>
<p>
You can easily customize the styles by defining the available <abbr aria-label="Cascading Stylesheet">CSS</abbr> custom properties (props) in the <code>:root</code>. Your own styles should come after <code>typesettings.css</code>.
</p>
<pre><code><link rel="stylesheet" href="[path]/typesettings.css"><br><style><br> :root {<br> …<br> }<br></style></code></pre>
<section aria-labelledby="color">
<h4 id="color">
Color
</h4>
<pre><code>:root {<br> --ts-color-body: [custom value];<br> --ts-color-heading: [custom value];<br> --ts-color-link: [custom value];<br> --ts-color-background: [custom value];<br> --ts-color-border: [custom value];<br>}</code></pre>
<p>
Example: <code>--ts-color-link: #0000ff;</code>
</p>
<p>
<abbr aria-label="Note">📣</abbr>: <em>Customize these colors in the context of light mode, because dark mode will invert all of them.</em>
</p>
</section>
<section aria-labelledby="font-family">
<h4 id="font-family">
Font-Family
</h4>
<pre><code>:root {<br> --ts-font-family-serif: [custom value];<br> --ts-font-family-sans: [custom value];<br> --ts-font-family-sans-alt: [custom value];<br> --ts-font-family-monospace: [custom value];<br>}</code></pre>
<p>
Example: <code>--ts-font-family-sans: 'Open Sans', sans-serif;</code>
</p>
<p>
<abbr aria-label="Note">📣</abbr>: <em>Just want the same font for heading and body? Use <code>--ts-font-family-only-one</code>.</em>
</p>
</section>
<section aria-labelledby="font-weight">
<h4 id="font-weight">
Font-Weight
</h4>
<pre><code>:root {<br> --ts-font-weight-regular: [custom value];<br> --ts-font-weight-bold: [custom value];<br>}</code></pre>
<p>
Example: <code>--ts-font-weight-bold: 600;</code>
</p>
</section>
<section aria-labelledby="paragraph">
<h4 id="paragraph">
Paragraph
</h4>
<pre><code>:root {<br> --ts-paragraph-spacing: [custom value];<br> --ts-paragraph-indent: [custom value];<br>}</code></pre>
<p>
Example: <code>--ts-paragraph-indent: 2em;</code>
</p>
</section>
</section>
</article>
</main>
</div>
</body>
</html>