@canonical/styles 0.5.0-experimental.0 → 0.6.0-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/index.css +6 -1
- package/src/typography.css +41 -135
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/styles",
|
|
3
3
|
"description": "Canonical's base styles",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0-experimental.0",
|
|
5
5
|
"main": "src/index.css",
|
|
6
6
|
"files": [
|
|
7
7
|
"src"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"normalize.css": "^8.0.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "08cae3a8ec07cc810e52fbd65bb052ff4d171dea"
|
|
36
36
|
}
|
package/src/index.css
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
/* Load external files first */
|
|
2
|
+
@import url("./font-faces.css");
|
|
3
|
+
|
|
1
4
|
/* Reset */
|
|
2
5
|
@import url("normalize.css");
|
|
3
6
|
|
|
4
7
|
/* Values and settings */
|
|
5
8
|
@import url("./tokens.css");
|
|
6
|
-
@import url("./font-faces.css");
|
|
7
9
|
|
|
8
10
|
/* Foundations styling */
|
|
11
|
+
@import url("@canonical/typography");
|
|
9
12
|
@import url("./typography.css");
|
|
13
|
+
|
|
14
|
+
/* Intents */
|
|
10
15
|
@import url("./intents.css");
|
package/src/typography.css
CHANGED
|
@@ -12,58 +12,13 @@ TODO
|
|
|
12
12
|
--font-family-mono: "Ubuntu Mono variable", "Ubuntu Mono", Consolas, Monaco,
|
|
13
13
|
Courier, monospace;
|
|
14
14
|
--text-max-width: 40em;
|
|
15
|
+
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
--
|
|
18
|
-
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
--font-size-h3: 1.5rem;
|
|
22
|
-
--font-size-h4: var(--font-size-h3);
|
|
23
|
-
|
|
24
|
-
--font-weight-bold: 550;
|
|
25
|
-
--font-weight-regular: 400;
|
|
26
|
-
--font-weight-thin: 300;
|
|
27
|
-
--font-weight-display-heading: 100;
|
|
28
|
-
--font-weight-h2: 180; /* custom font weight for h2 */
|
|
29
|
-
--font-weight-h4: 275; /* custom font weight for h4 */
|
|
30
|
-
|
|
31
|
-
--sp-unit: 0.5rem;
|
|
32
|
-
--spv-x-small: calc(0.5 * var(--sp-unit));
|
|
33
|
-
--spv-small: var(--sp-unit);
|
|
34
|
-
--spv-medium: calc(1.5 * var(--sp-unit));
|
|
35
|
-
--spv-large: calc(2 * var(--sp-unit));
|
|
36
|
-
--spv-x-large: calc(3 * var(--sp-unit));
|
|
37
|
-
--spv-strip-shallow: calc(3 * var(--sp-unit));
|
|
38
|
-
--spv-strip-regular: calc(8 * var(--sp-unit));
|
|
39
|
-
--spv-strip-deep: calc(16 * var(--sp-unit));
|
|
40
|
-
|
|
41
|
-
--sp-after-display: var(--spv-x-large);
|
|
42
|
-
--sp-after-h1: var(--spv-x-large);
|
|
43
|
-
--sp-after-h2: var(--sp-after-h1);
|
|
44
|
-
--sp-after-h3: var(--spv-x-large);
|
|
45
|
-
--sp-after-h4: var(--sp-after-h3);
|
|
46
|
-
--sp-after-p: var(--spv-x-large);
|
|
47
|
-
--sp-after-p-small-caps: var(--spv-large);
|
|
48
|
-
--sp-after-p-dense: var(--spv-large);
|
|
49
|
-
--sp-after-default-text: var(--sp-unit);
|
|
50
|
-
--sp-after-small: var(--spv-large);
|
|
51
|
-
--sp-after-small-dense: var(--spv-large);
|
|
52
|
-
--sp-after-x-small: var(--spv-large);
|
|
53
|
-
|
|
54
|
-
--line-height-default: calc(3 * var(--sp-unit));
|
|
55
|
-
--line-height-h1: calc(6 * var(--sp-unit));
|
|
56
|
-
--line-height-h2: var(--line-height-h1);
|
|
57
|
-
--line-height-h3: calc(4 * var(--sp-unit));
|
|
58
|
-
--line-height-h4: var(--line-height-h3);
|
|
59
|
-
|
|
60
|
-
--nudge-p: 0.375rem;
|
|
61
|
-
--nudge-h1: 0.55rem;
|
|
62
|
-
--nudge-h2: var(--nudge-h1);
|
|
63
|
-
--nudge-h3: 0.45rem;
|
|
64
|
-
--nudge-h4: var(--nudge-h3);
|
|
65
|
-
--nudge-h5: var(--nudge-p);
|
|
66
|
-
--nudge-h6: var(--nudge-p);
|
|
17
|
+
:root {
|
|
18
|
+
--baseline-height: .5rem;
|
|
19
|
+
--ascender: 830;
|
|
20
|
+
--descender: -170;
|
|
21
|
+
--units-per-em: 1000;
|
|
67
22
|
}
|
|
68
23
|
|
|
69
24
|
html {
|
|
@@ -71,112 +26,63 @@ html {
|
|
|
71
26
|
font-family: var(--font-family-sans);
|
|
72
27
|
-moz-osx-font-smoothing: grayscale;
|
|
73
28
|
-webkit-font-smoothing: antialiased;
|
|
74
|
-
font-weight:
|
|
75
|
-
font-size:
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
font-size: 1rem;
|
|
76
31
|
line-height: var(--line-height-default);
|
|
77
32
|
text-wrap: pretty;
|
|
78
33
|
}
|
|
79
34
|
|
|
80
35
|
/* FIXME: we would need to add many more selectors here, everything that is a heading (in components) */
|
|
36
|
+
p,
|
|
81
37
|
h1,
|
|
82
38
|
h2,
|
|
83
39
|
h3,
|
|
84
40
|
h4,
|
|
85
41
|
h5,
|
|
86
|
-
h6
|
|
87
|
-
.heading-1,
|
|
88
|
-
.heading-2,
|
|
89
|
-
.heading-3,
|
|
90
|
-
.heading-4,
|
|
91
|
-
.heading-5,
|
|
92
|
-
.heading-6 {
|
|
93
|
-
font-style: normal;
|
|
94
|
-
margin-top: 0;
|
|
42
|
+
h6 {
|
|
95
43
|
max-width: var(--text-max-width);
|
|
44
|
+
font-weight: var(--font-weight);
|
|
96
45
|
}
|
|
97
46
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
padding-top: var(--nudge-h1);
|
|
104
|
-
margin-bottom: calc(var(--sp-after-h1) - var(--nudge-h1));
|
|
47
|
+
p {
|
|
48
|
+
--font-size: 1rem;
|
|
49
|
+
--line-height-multiplier: 3;
|
|
50
|
+
--space-after: 3;
|
|
51
|
+
--font-weight: 400;
|
|
105
52
|
}
|
|
106
53
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
font-size:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
padding-top: var(--nudge-h2);
|
|
113
|
-
margin-bottom: calc(var(--sp-after-h2) - var(--nudge-h2));
|
|
54
|
+
h1 {
|
|
55
|
+
--line-height-multiplier: 6;
|
|
56
|
+
--font-size: 2.5rem;
|
|
57
|
+
--space-after: 3;
|
|
58
|
+
--font-weight: 550;
|
|
114
59
|
}
|
|
115
60
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
font-size:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
padding-top: var(--nudge-h3);
|
|
122
|
-
margin-bottom: calc(var(--sp-after-h3) - var(--nudge-h3));
|
|
61
|
+
h2 {
|
|
62
|
+
--line-height-multiplier: 6;
|
|
63
|
+
--font-size: 2.5rem;
|
|
64
|
+
--space-after: 3;
|
|
65
|
+
--font-weight: 180;
|
|
123
66
|
}
|
|
124
67
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
font-size:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
padding-top: var(--nudge-h4);
|
|
131
|
-
margin-bottom: calc(var(--sp-after-h4) - var(--nudge-h4));
|
|
68
|
+
h3 {
|
|
69
|
+
--line-height-multiplier: 4;
|
|
70
|
+
--font-size: 1.5rem;
|
|
71
|
+
--space-after: 3;
|
|
72
|
+
--font-weight: 550;
|
|
132
73
|
}
|
|
133
74
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
font-size:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
padding-top: var(--nudge-h5);
|
|
140
|
-
margin-bottom: calc(var(--sp-after-p) - var(--nudge-h5));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
h6,
|
|
144
|
-
.heading-6 {
|
|
145
|
-
font-size: var(--font-size-default);
|
|
146
|
-
font-style: italic;
|
|
147
|
-
font-weight: var(--font-weight-regular);
|
|
148
|
-
line-height: var(--line-height-default);
|
|
149
|
-
padding-top: var(--nudge-h6);
|
|
150
|
-
margin-bottom: calc(var(--sp-after-p) - var(--nudge-h6));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/*
|
|
154
|
-
Canonical specific:
|
|
155
|
-
consecutive headings of the same size should collapse margin between them
|
|
156
|
-
*/
|
|
157
|
-
h1,
|
|
158
|
-
h2,
|
|
159
|
-
.heading-1,
|
|
160
|
-
.heading-2 {
|
|
161
|
-
& + & {
|
|
162
|
-
margin-top: calc(-1 * var(--sp-after-h1));
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
h3,
|
|
167
|
-
h4,
|
|
168
|
-
.heading-3,
|
|
169
|
-
.heading-4 {
|
|
170
|
-
& + & {
|
|
171
|
-
margin-top: calc(-1 * var(--sp-after-h3));
|
|
172
|
-
}
|
|
75
|
+
h4 {
|
|
76
|
+
--line-height-multiplier: 4;
|
|
77
|
+
--font-size: 1.5rem;
|
|
78
|
+
--space-after: 3;
|
|
79
|
+
--font-weight: 275;
|
|
173
80
|
}
|
|
174
81
|
|
|
175
82
|
h5,
|
|
176
|
-
h6
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
83
|
+
h6 {
|
|
84
|
+
--line-height-multiplier: 3;
|
|
85
|
+
--font-size: 1rem;
|
|
86
|
+
--space-after: 2;
|
|
87
|
+
--font-weight: 400;
|
|
182
88
|
}
|