Skip to content

Commit 7d04ac9

Browse files
Assign figma variables to default antora styles + theme switcher + new fonts (#2)
* css variables, theme switching, style updates, font files and material icons * hljs colors, top logo * code font color * style lint * fix bundle step
1 parent cae8cc0 commit 7d04ac9

19 files changed

+879
-195
lines changed

gulp.d/tasks/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ module.exports = (src, dest, preview) => () => {
4747
},
4848
},
4949
]),
50-
postcssVar({ preserve: preview }),
50+
// NOTE because css vars are our theme switching mechanism we must preserve them with preserve: true
51+
postcssVar({ preserve: true }),
5152
// NOTE to make vars.css available to all top-level stylesheets, use the next line in place of the previous one
5253
//postcssVar({ importFrom: path.join(src, 'css', 'vars.css'), preserve: preview }),
5354
preview ? postcssCalc : () => {}, // cssnano already applies postcssCalc

package-lock.json

Lines changed: 13 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
],
1616
"devDependencies": {
1717
"@asciidoctor/core": "~2.2",
18-
"@fontsource/roboto": "~4.5",
19-
"@fontsource/roboto-mono": "~4.5",
18+
"@fontsource/material-icons-outlined": "~5.0",
19+
"@fontsource/roboto-flex": "~5.0",
20+
"@fontsource/roboto-mono": "~5.0",
2021
"autoprefixer": "~9.7",
2122
"browser-pack-flat": "~3.4",
2223
"browserify": "~16.5",

src/css/base.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ body {
2525
margin: 0;
2626
tab-size: 4;
2727
word-wrap: anywhere; /* aka overflow-wrap; used when hyphens are disabled or aren't sufficient */
28+
/* ds-text-body */
29+
font-size: 1rem;
30+
font-weight: 400;
2831
}
2932

3033
a {

src/css/doc.css

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,40 @@
2525
.doc h5,
2626
.doc h6 {
2727
color: var(--heading-font-color);
28-
font-weight: var(--heading-font-weight);
2928
hyphens: none;
30-
line-height: 1.3;
29+
line-height: 1.5;
3130
margin: 1rem 0 0;
3231
}
3332

3433
.doc > h1.page:first-child {
35-
font-size: calc(36 / var(--rem-base) * 1rem);
34+
/* font-size: calc(36 / var(--rem-base) * 1rem); */
3635
margin: 1.5rem 0;
3736
}
3837

38+
.doc h1 {
39+
/* .ds-text-h1 */
40+
font-size: 1.5rem;
41+
font-weight: 600;
42+
}
43+
44+
.doc h2 {
45+
/* .ds-text-h2 */
46+
font-size: 1.25rem;
47+
font-weight: 600;
48+
}
49+
50+
.doc h3 {
51+
/* .ds-text-h3 { */
52+
font-size: 1rem;
53+
font-weight: 600;
54+
}
55+
56+
.doc h4 {
57+
/* .ds-text-h4 */
58+
font-size: 0.938rem;
59+
font-weight: 600;
60+
}
61+
3962
@media screen and (min-width: 769px) {
4063
.doc > h1.page:first-child {
4164
margin-top: 2.5rem;
@@ -82,12 +105,13 @@
82105
.doc h6 .anchor {
83106
position: absolute;
84107
text-decoration: none;
85-
width: 1.75ex;
86-
margin-left: -1.5ex;
108+
width: 2.75ex;
109+
margin-left: -2.5ex;
87110
visibility: hidden;
88-
font-size: 0.8em;
111+
/* font-size: 0.8em; */
89112
font-weight: normal;
90-
padding-top: 0.05em;
113+
/* padding-top: 0.05em; */
114+
color: var(--ds-primary-soft-hover-bg);
91115
}
92116

93117
.doc h1 .anchor::before,
@@ -96,7 +120,8 @@
96120
.doc h4 .anchor::before,
97121
.doc h5 .anchor::before,
98122
.doc h6 .anchor::before {
99-
content: "\00a7";
123+
font-family: "Material Icons Outlined", sans-serif;
124+
content: "\f1cd";
100125
}
101126

102127
.doc h1:hover .anchor,

src/css/ds-typography.css

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
.ds-text-display {
2+
font-size: 2.125rem;
3+
font-weight: 600;
4+
}
5+
6+
.ds-text-h1 {
7+
font-size: 1.5rem;
8+
font-weight: 600;
9+
}
10+
11+
.ds-text-h2 {
12+
font-size: 1.25rem;
13+
font-weight: 600;
14+
}
15+
16+
.ds-text-h3 {
17+
font-size: 1rem;
18+
font-weight: 600;
19+
}
20+
21+
.ds-text-h4 {
22+
font-size: 0.938rem;
23+
font-weight: 600;
24+
}
25+
26+
.ds-text-body {
27+
font-size: 1rem;
28+
font-weight: 400;
29+
}
30+
31+
.ds-text-body-small {
32+
font-size: 0.906rem;
33+
font-weight: 400;
34+
}
35+
36+
.ds-text-caption {
37+
font-size: 0.906rem;
38+
font-weight: 500;
39+
}
40+
41+
.ds-text-label {
42+
font-size: 0.8125rem;
43+
font-weight: 600;
44+
}
45+
46+
.ds-text-overline {
47+
font-size: 0.75rem;
48+
font-weight: 650;
49+
letter-spacing: 0.075rem;
50+
text-transform: uppercase;
51+
}
52+
53+
.ds-text-button {
54+
font-size: 0.90625rem;
55+
font-weight: 600;
56+
}
57+
58+
.ds-text-tab {
59+
font-size: 1rem;
60+
font-weight: 400;
61+
}
62+
63+
.ds-text-mono {
64+
font-family: "Roboto Mono", monospace;
65+
font-size: 0.96875rem;
66+
font-weight: 400;
67+
}
68+
69+
.ds-text-mono-small {
70+
font-family: "Roboto Mono", monospace;
71+
font-size: 0.875rem;
72+
font-weight: 400;
73+
}

0 commit comments

Comments
 (0)