@carissa-io/theme-default 0.2.1 → 0.2.2
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/DESIGN.md +21 -10
- package/README.md +3 -2
- package/dist/index.css +121 -0
- package/package.json +7 -2
- package/scss/_tokens.scss +1 -0
- package/scss/index.scss +78 -0
package/DESIGN.md
CHANGED
|
@@ -27,18 +27,29 @@ The same palette is available as Sass tokens (`$black`, `$muted`, `$surface`, `$
|
|
|
27
27
|
instead of copying the hex values, so a change of value here reaches them with the next release.
|
|
28
28
|
|
|
29
29
|
## Typography
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
30
|
+
Configured through [components-typography](components/components-typography): `Heading` (the element comes from `level`, the look from `size`)
|
|
31
|
+
and `Text`. Neutral grotesque, no margins (spacing belongs to the layout), color from `$text`; only muted text uses `$muted`.
|
|
32
|
+
|
|
33
|
+
| Style | Size / line height | Weight | Tracking | Purpose |
|
|
34
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
35
|
+
| `display` | 3.5rem / 1.05 | Black (900) | -0.04em | Hero statements |
|
|
36
|
+
| `h1` | 2.5rem / 1.1 | Black (900) | -0.03em | Primary page header |
|
|
37
|
+
| `h2` | 1.75rem / 1.2 | Black (900) | -0.02em | Section header |
|
|
38
|
+
| `h3` | 1.25rem / 1.3 | Bold (700) | normal | Sub-section |
|
|
39
|
+
| `h4` | 1.125rem / 1.3 | Bold (700) | normal | Group title |
|
|
40
|
+
| `h5` | 1rem / 1.4 | Bold (700) | normal | Minor title |
|
|
41
|
+
| `h6` | 0.875rem / 1.4 | Bold (700) | normal | Smallest title |
|
|
42
|
+
| `lead` | 1.25rem / 1.5 | Regular (400) | normal | Introductory paragraph |
|
|
43
|
+
| `body` | 1rem / 1.5 | Regular (400) | normal | Main content |
|
|
44
|
+
| `small` | 0.875rem / 1.5 | Regular (400) | normal | Secondary content |
|
|
45
|
+
| `caption` | 0.75rem / 1.4 | Regular (400), muted by use | normal | Notes under media or fields |
|
|
46
|
+
| `overline` | 0.6875rem / 1.4 | Bold (700), uppercase | 0.1em | Metadata / tags: the field-label style |
|
|
47
|
+
| `mono` | 0.875rem / 1.5 | Regular (400) | normal | System data, in `$font-family-mono` |
|
|
38
48
|
|
|
39
49
|
Font family: a neutral grotesque stack, `Helvetica Neue, Helvetica, Arial, Liberation Sans, sans-serif`, in keeping with
|
|
40
|
-
the International Typographic Style. No webfont is loaded, so a theme never depends on the network.
|
|
41
|
-
|
|
50
|
+
the International Typographic Style. No webfont is loaded, so a theme never depends on the network. System data uses the
|
|
51
|
+
`$font-family-mono` token, a system monospace stack (`ui-monospace, SFMono-Regular, Menlo, Consolas, Liberation Mono`).
|
|
52
|
+
Field text is 1rem (16px, which also avoids the zoom-on-focus of mobile browsers); labels are 11px.
|
|
42
53
|
|
|
43
54
|
## Buttons
|
|
44
55
|
Three variants from [components-button](components/components-button), all square, 44px tall, with the same uppercase,
|
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ change.
|
|
|
50
50
|
| `$disabled-border` | `#d4d4d4` | disabled borders |
|
|
51
51
|
| `$error` | `#dc3545` | error text and borders |
|
|
52
52
|
| `$font-family` | `'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif` | type stack |
|
|
53
|
+
| `$font-family-mono` | `ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace` | monospace stack for system data and code |
|
|
53
54
|
| `$radius` | `0` | corner radius |
|
|
54
55
|
| `$min-height` | `2.75rem` | touch target |
|
|
55
56
|
| `$focus-color` | `$black` | focus color |
|
|
@@ -84,11 +85,11 @@ it: check the names against the theme's `scss/_tokens.scss` before you switch.
|
|
|
84
85
|
|
|
85
86
|
## What it configures
|
|
86
87
|
`components-input`, `-button`, `-checkbox`, `-switch`, `-radio-group`, `-slider`, `-popover`, `-listbox`, `-select`,
|
|
87
|
-
`-combobox`, `-upload`, `-calendar`, `-date-picker` and `-
|
|
88
|
+
`-combobox`, `-upload`, `-calendar`, `-date-picker`, `-search` and `-typography`. `components-email`, `-password`, `-url` and `-textarea`
|
|
88
89
|
are styled through the input.
|
|
89
90
|
|
|
90
91
|
## Change a value
|
|
91
|
-
The palette and the values shared by every component (radius, minimum height, focus ring, transition, label style, dropdown
|
|
92
|
+
The palette and the values shared by every component (fonts, radius, minimum height, focus ring, transition, label style, dropdown
|
|
92
93
|
arrow) are the Sass variables of `scss/_tokens.scss` (the [tokens](#tokens)); each component has one `@use ... with (...)` block of overrides
|
|
93
94
|
below. Change the value, run `npm run build`, and update [DESIGN.md](DESIGN.md) if the decision changes.
|
|
94
95
|
|
package/dist/index.css
CHANGED
|
@@ -1146,3 +1146,124 @@
|
|
|
1146
1146
|
.c-search__clear:hover:not(:disabled) {
|
|
1147
1147
|
color: #000;
|
|
1148
1148
|
}
|
|
1149
|
+
|
|
1150
|
+
.c-heading {
|
|
1151
|
+
margin: 0;
|
|
1152
|
+
font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
|
|
1153
|
+
color: #171717;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
.c-heading--display {
|
|
1157
|
+
font-size: 3.5rem;
|
|
1158
|
+
font-weight: 900;
|
|
1159
|
+
line-height: 1.05;
|
|
1160
|
+
letter-spacing: -0.04em;
|
|
1161
|
+
text-transform: none;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
.c-heading--1 {
|
|
1165
|
+
font-size: 2.5rem;
|
|
1166
|
+
font-weight: 900;
|
|
1167
|
+
line-height: 1.1;
|
|
1168
|
+
letter-spacing: -0.03em;
|
|
1169
|
+
text-transform: none;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
.c-heading--2 {
|
|
1173
|
+
font-size: 1.75rem;
|
|
1174
|
+
font-weight: 900;
|
|
1175
|
+
line-height: 1.2;
|
|
1176
|
+
letter-spacing: -0.02em;
|
|
1177
|
+
text-transform: none;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
.c-heading--3 {
|
|
1181
|
+
font-size: 1.25rem;
|
|
1182
|
+
font-weight: 700;
|
|
1183
|
+
line-height: 1.3;
|
|
1184
|
+
letter-spacing: normal;
|
|
1185
|
+
text-transform: none;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.c-heading--4 {
|
|
1189
|
+
font-size: 1.125rem;
|
|
1190
|
+
font-weight: 700;
|
|
1191
|
+
line-height: 1.3;
|
|
1192
|
+
letter-spacing: normal;
|
|
1193
|
+
text-transform: none;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
.c-heading--5 {
|
|
1197
|
+
font-size: 1rem;
|
|
1198
|
+
font-weight: 700;
|
|
1199
|
+
line-height: 1.4;
|
|
1200
|
+
letter-spacing: normal;
|
|
1201
|
+
text-transform: none;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
.c-heading--6 {
|
|
1205
|
+
font-size: 0.875rem;
|
|
1206
|
+
font-weight: 700;
|
|
1207
|
+
line-height: 1.4;
|
|
1208
|
+
letter-spacing: normal;
|
|
1209
|
+
text-transform: none;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
.c-text {
|
|
1213
|
+
margin: 0;
|
|
1214
|
+
font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
|
|
1215
|
+
color: #171717;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
.c-text--body {
|
|
1219
|
+
font-size: 1rem;
|
|
1220
|
+
font-weight: 400;
|
|
1221
|
+
line-height: 1.5;
|
|
1222
|
+
letter-spacing: normal;
|
|
1223
|
+
text-transform: none;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.c-text--lead {
|
|
1227
|
+
font-size: 1.25rem;
|
|
1228
|
+
font-weight: 400;
|
|
1229
|
+
line-height: 1.5;
|
|
1230
|
+
letter-spacing: normal;
|
|
1231
|
+
text-transform: none;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
.c-text--small {
|
|
1235
|
+
font-size: 0.875rem;
|
|
1236
|
+
font-weight: 400;
|
|
1237
|
+
line-height: 1.5;
|
|
1238
|
+
letter-spacing: normal;
|
|
1239
|
+
text-transform: none;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.c-text--caption {
|
|
1243
|
+
font-size: 0.75rem;
|
|
1244
|
+
font-weight: 400;
|
|
1245
|
+
line-height: 1.4;
|
|
1246
|
+
letter-spacing: normal;
|
|
1247
|
+
text-transform: none;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
.c-text--overline {
|
|
1251
|
+
font-size: 0.6875rem;
|
|
1252
|
+
font-weight: 700;
|
|
1253
|
+
line-height: 1.4;
|
|
1254
|
+
letter-spacing: 0.1em;
|
|
1255
|
+
text-transform: uppercase;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.c-text--mono {
|
|
1259
|
+
font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
|
|
1260
|
+
font-size: 0.875rem;
|
|
1261
|
+
font-weight: 400;
|
|
1262
|
+
line-height: 1.5;
|
|
1263
|
+
letter-spacing: normal;
|
|
1264
|
+
text-transform: none;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
.c-text--muted {
|
|
1268
|
+
color: #737373;
|
|
1269
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carissa-io/theme-default",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Carissa UI: the default theme (Swiss minimalism) as SCSS variable overrides of the Carissa components, with a compiled CSS build",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"style": "dist/index.css",
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
"@carissa-io/components-upload": "^0.1.1",
|
|
52
52
|
"@carissa-io/components-calendar": "^0.1.1",
|
|
53
53
|
"@carissa-io/components-date-picker": "^0.1.1",
|
|
54
|
-
"@carissa-io/components-search": "^0.1.1"
|
|
54
|
+
"@carissa-io/components-search": "^0.1.1",
|
|
55
|
+
"@carissa-io/components-typography": "^0.1.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependenciesMeta": {
|
|
57
58
|
"@carissa-io/components-input": {
|
|
@@ -107,6 +108,9 @@
|
|
|
107
108
|
},
|
|
108
109
|
"@carissa-io/components-search": {
|
|
109
110
|
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"@carissa-io/components-typography": {
|
|
113
|
+
"optional": true
|
|
110
114
|
}
|
|
111
115
|
},
|
|
112
116
|
"devDependencies": {
|
|
@@ -123,6 +127,7 @@
|
|
|
123
127
|
"@carissa-io/components-select": "^0.1.1",
|
|
124
128
|
"@carissa-io/components-slider": "^0.1.1",
|
|
125
129
|
"@carissa-io/components-switch": "^0.1.1",
|
|
130
|
+
"@carissa-io/components-typography": "^0.1.0",
|
|
126
131
|
"@carissa-io/components-upload": "^0.1.1",
|
|
127
132
|
"sass-embedded": "^1.105.1",
|
|
128
133
|
"vitest": "^4.1.11"
|
package/scss/_tokens.scss
CHANGED
|
@@ -20,6 +20,7 @@ $error: #dc3545;
|
|
|
20
20
|
|
|
21
21
|
// Values shared by every component, so the whole theme moves together.
|
|
22
22
|
$font-family: ('Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif);
|
|
23
|
+
$font-family-mono: (ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace); // system data, code
|
|
23
24
|
$radius: 0;
|
|
24
25
|
$min-height: 2.75rem; // 44px touch target
|
|
25
26
|
$focus-color: $black;
|
package/scss/index.scss
CHANGED
|
@@ -479,3 +479,81 @@
|
|
|
479
479
|
// Motion
|
|
480
480
|
$c-search-transition: color $transition-duration ease
|
|
481
481
|
);
|
|
482
|
+
|
|
483
|
+
// Typography: Heading and Text, the hierarchy of every screen. The scale follows DESIGN.md: black (900) with tight
|
|
484
|
+
// tracking for display, 1 and 2, bold (700) from 3 down, regular body; the overline is the field-label style, and the
|
|
485
|
+
// mono variant uses the $font-family-mono token. No margins (spacing belongs to the layout). No other component block
|
|
486
|
+
// forwards it, so it can go anywhere; it stays last.
|
|
487
|
+
@use '@carissa-io/components-typography/scss' as typography with (
|
|
488
|
+
// Headings
|
|
489
|
+
$c-heading-font-family: $font-family,
|
|
490
|
+
$c-heading-color: $text,
|
|
491
|
+
|
|
492
|
+
$c-heading-display-font-size: 3.5rem,
|
|
493
|
+
$c-heading-display-font-weight: 900,
|
|
494
|
+
$c-heading-display-line-height: 1.05,
|
|
495
|
+
$c-heading-display-letter-spacing: -0.04em,
|
|
496
|
+
|
|
497
|
+
$c-heading-1-font-size: 2.5rem,
|
|
498
|
+
$c-heading-1-font-weight: 900,
|
|
499
|
+
$c-heading-1-line-height: 1.1,
|
|
500
|
+
$c-heading-1-letter-spacing: -0.03em,
|
|
501
|
+
|
|
502
|
+
$c-heading-2-font-size: 1.75rem,
|
|
503
|
+
$c-heading-2-font-weight: 900,
|
|
504
|
+
$c-heading-2-line-height: 1.2,
|
|
505
|
+
$c-heading-2-letter-spacing: -0.02em,
|
|
506
|
+
|
|
507
|
+
$c-heading-3-font-size: 1.25rem,
|
|
508
|
+
$c-heading-3-font-weight: 700,
|
|
509
|
+
$c-heading-3-line-height: 1.3,
|
|
510
|
+
$c-heading-3-letter-spacing: normal,
|
|
511
|
+
|
|
512
|
+
$c-heading-4-font-size: 1.125rem,
|
|
513
|
+
$c-heading-4-font-weight: 700,
|
|
514
|
+
$c-heading-4-line-height: 1.3,
|
|
515
|
+
$c-heading-4-letter-spacing: normal,
|
|
516
|
+
|
|
517
|
+
$c-heading-5-font-size: 1rem,
|
|
518
|
+
$c-heading-5-font-weight: 700,
|
|
519
|
+
$c-heading-5-line-height: 1.4,
|
|
520
|
+
$c-heading-5-letter-spacing: normal,
|
|
521
|
+
|
|
522
|
+
$c-heading-6-font-size: 0.875rem,
|
|
523
|
+
$c-heading-6-font-weight: 700,
|
|
524
|
+
$c-heading-6-line-height: 1.4,
|
|
525
|
+
$c-heading-6-letter-spacing: normal,
|
|
526
|
+
|
|
527
|
+
// Text
|
|
528
|
+
$c-text-font-family: $font-family,
|
|
529
|
+
$c-text-color: $text,
|
|
530
|
+
$c-text-muted-color: $muted,
|
|
531
|
+
$c-text-mono-font-family: $font-family-mono,
|
|
532
|
+
|
|
533
|
+
$c-text-body-font-size: 1rem,
|
|
534
|
+
$c-text-body-font-weight: 400,
|
|
535
|
+
$c-text-body-line-height: 1.5,
|
|
536
|
+
|
|
537
|
+
$c-text-lead-font-size: 1.25rem,
|
|
538
|
+
$c-text-lead-font-weight: 400,
|
|
539
|
+
$c-text-lead-line-height: 1.5,
|
|
540
|
+
|
|
541
|
+
$c-text-small-font-size: 0.875rem,
|
|
542
|
+
$c-text-small-font-weight: 400,
|
|
543
|
+
$c-text-small-line-height: 1.5,
|
|
544
|
+
|
|
545
|
+
$c-text-caption-font-size: 0.75rem,
|
|
546
|
+
$c-text-caption-font-weight: 400,
|
|
547
|
+
$c-text-caption-line-height: 1.4,
|
|
548
|
+
|
|
549
|
+
// Overline: the field-label style
|
|
550
|
+
$c-text-overline-font-size: $label-font-size,
|
|
551
|
+
$c-text-overline-font-weight: $label-font-weight,
|
|
552
|
+
$c-text-overline-line-height: 1.4,
|
|
553
|
+
$c-text-overline-letter-spacing: $label-letter-spacing,
|
|
554
|
+
$c-text-overline-text-transform: uppercase,
|
|
555
|
+
|
|
556
|
+
$c-text-mono-font-size: 0.875rem,
|
|
557
|
+
$c-text-mono-font-weight: 400,
|
|
558
|
+
$c-text-mono-line-height: 1.5
|
|
559
|
+
);
|