@nordcode/ui 1.1.7 → 1.3.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.
@@ -11,7 +11,7 @@
11
11
  inline-size: 100%;
12
12
 
13
13
  &:not(:last-child) {
14
- margin-block-end: 1ch;
14
+ margin-block-end: 0.5em;
15
15
  }
16
16
  }
17
17
 
@@ -20,9 +20,9 @@
20
20
  inline-size: auto;
21
21
 
22
22
  &:not(:last-child):after {
23
- content: '';
23
+ content: "";
24
24
  border-right: var(--border-width-medium) solid var(--color-border-muted);
25
- margin: 0 1ch;
25
+ margin: 0 0.5em;
26
26
  transform: calc(var(--border-width-medium) / 2);
27
27
  }
28
28
  }
@@ -3,9 +3,10 @@
3
3
  --_notification-max-width: var(--notifications-max-width, 20rem);
4
4
  --_notification-gap: var(--notification-gap, var(--spacing-base));
5
5
  --_notification-border-color: var(--notification-border-color, var(--color-border-base));
6
- --_notification-center-background: var(--notification-center-background,
7
- color-mix(in oklch, var(---color-surface-subtle), transparent 95%);
8
- );
6
+ --_notification-center-background: var(
7
+ --notification-center-background,
8
+ color-mix(in oklch, var(---color-surface-subtle), transparent 95%)
9
+ );
9
10
  }
10
11
 
11
12
  :where(.nc-notification-center, .nc-notification-output) {
@@ -61,7 +62,7 @@
61
62
  }
62
63
 
63
64
  :where(.nc-notification) {
64
- padding: 0.5lh 2ch;
65
+ padding: 0.5em 1em;
65
66
  background: var(--color-surface-base);
66
67
  border: var(--border-width-thin) solid var(--_notification-border-color);
67
68
  display: flex;
@@ -98,7 +99,7 @@
98
99
  justify-content: space-between;
99
100
  align-items: flex-end;
100
101
  inline-size: 100%;
101
- margin-block-start: 0.5ch;
102
+ margin-block-start: 0.25em;
102
103
  }
103
104
 
104
105
  :where(.nc-notification .nc-button, .nc-notification-center .nc-button) {
@@ -107,7 +108,8 @@
107
108
  }
108
109
 
109
110
  :where(.nc-notification.-closing) {
110
- animation: remove-notification var(--transition-duration-base) cubic-bezier(0.7, 0, 1, 1) forwards;
111
+ animation: remove-notification var(--transition-duration-base) cubic-bezier(0.7, 0, 1, 1)
112
+ forwards;
111
113
  }
112
114
 
113
115
  @keyframes pop-in {
@@ -17,16 +17,17 @@
17
17
  --line-height-small: 1.1;
18
18
 
19
19
  --tracking-base: normal;
20
- --tracking-tight: -0.04ch;
21
- --tracking-wide: 0.06ch;
20
+ --tracking-tight: -0.02em;
21
+ --tracking-wide: 0.03em;
22
22
 
23
- --measure-large: 88ch;
24
- --measure-base: 72ch;
25
- --measure-small: 44ch;
23
+ --measure-large: 44em;
24
+ --measure-base: 36em;
25
+ --measure-small: 22em;
26
26
 
27
27
  --font-size-smallest: max(0.75rem, 12px);
28
28
  --font-size-small: max(0.875rem, 14px);
29
29
  --font-size-base: 1rem;
30
+ --font-size-medium: 1.125rem;
30
31
  --font-size-large: 1.25rem;
31
32
  --font-size-largest: 1.5rem;
32
33
  --font-size-display: 3.5rem;
@@ -26,7 +26,7 @@
26
26
  inline-size: 100%;
27
27
  max-inline-size: 100%;
28
28
  align-items: flex-start;
29
- word-break: break-word;
29
+ overflow-wrap: anywhere;
30
30
  container: description-list / inline-size;
31
31
  row-gap: 0.5lh;
32
32
  }
@@ -39,7 +39,7 @@
39
39
  @container description-list (min-width: 30rem) {
40
40
  :where(dt) {
41
41
  grid-column: 1 / 1;
42
- padding-inline-end: 2ch;
42
+ padding-inline-end: 1em;
43
43
  padding-block-end: 0;
44
44
  min-block-size: 100%;
45
45
 
@@ -78,19 +78,20 @@
78
78
  display: block;
79
79
  color: var(--color-surface-subtle);
80
80
  background-color: var(--color-text-base);
81
- padding: 0.25lh 1ch;
81
+ padding: 0.35em 0.5em;
82
82
  }
83
83
 
84
84
  :where(details) {
85
- --p-x-details: 2ch;
86
- --p-y-details: 0.75lh;
85
+ --p-x-details: 1em;
86
+ --p-y-details: 1em;
87
87
  --b-r-details: var(--border-radius-medium);
88
88
 
89
89
  background-color: var(--color-surface-muted);
90
90
  border-radius: var(--b-r-details);
91
- border: var(--border-width-thin) solid var(--color-border-base);
91
+ /* border: var(--border-width-thin) solid var(--color-border-base); */
92
92
  padding: var(--p-y-details) var(--p-x-details);
93
93
  inline-size: 100%;
94
+ box-shadow: 0 0 0 var(--border-width-thin) var(--color-border-base);
94
95
 
95
96
  & > summary {
96
97
  color: var(--color-text-base);
@@ -98,8 +99,7 @@
98
99
  font-weight: var(--font-weight-heading);
99
100
  border-radius: var(--b-r-details);
100
101
  padding: var(--p-y-details) var(--p-x-details);
101
- margin: calc(-1 * var(--p-y-details))
102
- calc(-1 * var(--p-x-details) + var(--border-width-thin));
102
+ margin: calc(-1 * var(--p-y-details)) calc(-1 * var(--p-x-details));
103
103
  }
104
104
 
105
105
  &[open] > summary {
@@ -112,7 +112,7 @@
112
112
  .note,
113
113
  blockquote {
114
114
  padding: 0;
115
- padding-inline-start: 2ch;
115
+ padding-inline-start: 1em;
116
116
  inline-size: 100%;
117
117
  color: var(--color-text-base);
118
118
  position: relative;
@@ -148,7 +148,7 @@
148
148
 
149
149
  & cite:before {
150
150
  content: "—";
151
- margin-inline-end: 0.5ch;
151
+ margin-inline-end: 0.5em;
152
152
  }
153
153
  }
154
154
 
@@ -209,7 +209,7 @@
209
209
  color: inherit;
210
210
  font-family: var(--font-family-link);
211
211
  text-decoration: underline;
212
- text-underline-offset: 0.25lh;
212
+ text-underline-offset: 0.35em;
213
213
  text-decoration-thickness: from-font;
214
214
  font-weight: var(--font-weight-default);
215
215
  text-decoration-color: currentColor;
@@ -254,7 +254,7 @@
254
254
  }
255
255
 
256
256
  :where(del, ins, mark, code, kbd, var) {
257
- padding-inline: 0.5ch;
257
+ padding-inline: 0.25em;
258
258
  border-radius: var(--border-radius-small);
259
259
  line-height: inherit;
260
260
  box-decoration-break: clone;
@@ -265,14 +265,13 @@
265
265
  font-family: var(--font-family-mono);
266
266
  letter-spacing: 0;
267
267
  font-weight: var(--font-weight-default);
268
- padding-block: 0.125lh;
268
+ padding-block: 0.2em;
269
269
  max-inline-size: fit-content;
270
270
  hyphens: none;
271
271
  tab-size: 4;
272
272
  text-align: left;
273
273
  word-spacing: normal;
274
- word-break: normal;
275
- word-wrap: normal;
274
+ overflow-wrap: normal;
276
275
  font-style: normal;
277
276
  }
278
277
 
@@ -293,7 +292,7 @@
293
292
  }
294
293
 
295
294
  :where(pre) {
296
- padding: 0.5lh 2ch;
295
+ padding: 1em;
297
296
  inline-size: 100%;
298
297
  overflow-x: auto;
299
298
  color: var(--color-text-base);
@@ -337,7 +336,7 @@
337
336
  }
338
337
 
339
338
  :where(td, th) {
340
- padding: 0.4lh 1ch;
339
+ padding: 0.5em;
341
340
  line-height: var(--line-height-small);
342
341
  white-space: nowrap;
343
342
  font-variant-numeric: tabular-nums;
@@ -412,15 +411,15 @@
412
411
  }
413
412
 
414
413
  :where(ul, ol) {
415
- padding-inline-start: 2ch;
414
+ padding-inline-start: 1em;
416
415
  }
417
416
 
418
417
  :where(li + li) {
419
- margin-block-start: 0.5lh;
418
+ margin-block-start: 0.5em;
420
419
  }
421
420
 
422
421
  :where(li > :is(ul, ol)) {
423
- margin-block-start: 0.25lh;
422
+ margin-block-start: 0.5em;
424
423
  }
425
424
 
426
425
  @supports (font-variant-position: sub) {
@@ -466,7 +465,7 @@
466
465
  }
467
466
 
468
467
  :where(.quoted p:first-of-type::before) {
469
- margin-inline-start: -0.87ch;
468
+ margin-inline-start: -0.5em;
470
469
  }
471
470
  :where(.quoted p) {
472
471
  hanging-punctuation: first last;
@@ -1,5 +1,4 @@
1
1
  @layer utils {
2
-
3
2
  /* Layout classes that handle 80% of the layout*/
4
3
  :where(.nc-box) {
5
4
  padding: var(--spacing-base);
@@ -43,35 +42,35 @@
43
42
  &.-stretched {
44
43
  inline-size: 100%;
45
44
 
46
- &>* {
45
+ & > * {
47
46
  inline-size: 100%;
48
47
  }
49
48
  }
50
49
 
51
- &.-contained>* {
50
+ &.-contained > * {
52
51
  max-inline-size: 100%;
53
52
  }
54
53
  }
55
54
 
56
55
  :where(.nc-flow) {
57
- >*+* {
56
+ > * + * {
58
57
  margin-block-start: var(--flow-gap, 1lh);
59
58
  }
60
59
 
61
- >* {
62
- max-inline-size: var(--flow-base-meassure, 72ch);
60
+ > * {
61
+ max-inline-size: var(--flow-base-meassure, 36em);
63
62
  }
64
63
 
65
- >*:is(h1, h2, h3, h4, h5, h6) {
66
- max-inline-size: var(--flow-headline-meassure, 32ch);
64
+ > *:is(h1, h2, h3, h4, h5, h6) {
65
+ max-inline-size: var(--flow-headline-meassure, 16em);
67
66
  --flow-gap: 1.5lh;
68
67
  }
69
68
 
70
- >*:is(h1, h2, h3, h4, h5, h6)+ :not([class]) {
69
+ > *:is(h1, h2, h3, h4, h5, h6) + :not([class]) {
71
70
  --flow-gap: 0.5lh;
72
71
  }
73
72
 
74
- >figure {
73
+ > figure {
75
74
  margin-inline: 0;
76
75
  }
77
76
 
@@ -126,13 +125,13 @@
126
125
  align-items: flex-start;
127
126
  gap: var(--with-sidebar-gap, var(--spacing-far));
128
127
 
129
- &>[data-aside] {
128
+ & > [data-aside] {
130
129
  flex-grow: 1;
131
130
  min-width: min-content;
132
131
  flex-basis: var(--with-sidebar-target-width, 20rem);
133
132
  }
134
133
 
135
- &>[data-grow] {
134
+ & > [data-grow] {
136
135
  flex-basis: 0;
137
136
  flex-grow: 999;
138
137
  min-width: var(--with-sidebar-min-size, 50%);
@@ -165,8 +164,10 @@
165
164
  */
166
165
  :where(.nc-grid) {
167
166
  display: grid;
168
- grid-template-columns: repeat(var(--grid-placement, auto-fill),
169
- minmax(var(--grid-min-item-size, 16rem), 1fr));
167
+ grid-template-columns: repeat(
168
+ var(--grid-placement, auto-fill),
169
+ minmax(var(--grid-min-item-size, 16rem), 1fr)
170
+ );
170
171
  gap: var(--grid-gap, var(--spacing-base));
171
172
 
172
173
  /* A split 50/50 layout */
@@ -206,7 +207,7 @@
206
207
  gap: var(--switcher-gap, var(--spacing-base));
207
208
  align-items: var(--switcher-vertical-alignment, flex-start);
208
209
 
209
- &>* {
210
+ & > * {
210
211
  flex-grow: 1;
211
212
  flex-basis: calc((var(--switcher-target-container-width, 40rem) - 100%) * 999);
212
213
  }
@@ -214,7 +215,7 @@
214
215
  /* Max 2 items,
215
216
  so anything greater than 2 is ful width */
216
217
 
217
- &> :nth-child(n + 4) {
218
+ & > :nth-child(n + 4) {
218
219
  flex-basis: 100%;
219
220
  }
220
221
  }
@@ -227,7 +228,7 @@
227
228
  place-items: center;
228
229
  grid: [pile] 1fr / [pile] 1fr;
229
230
 
230
- &>* {
231
+ & > * {
231
232
  grid-area: pile;
232
233
  }
233
234
  }
@@ -241,11 +242,21 @@
241
242
 
242
243
  display: grid;
243
244
  gap: var(--_nc-ram-grid-gap-column) var(--_nc-ram-grid-gap-row);
244
- grid-template-columns: repeat(var(--_nc-ram-grid-repeat-count),
245
- minmax(min(var(--_nc-ram-grid-min-width), 100%), 1fr));
245
+ grid-template-columns: repeat(
246
+ var(--_nc-ram-grid-repeat-count),
247
+ minmax(min(var(--_nc-ram-grid-min-width), 100%), 1fr)
248
+ );
246
249
  }
247
250
 
248
- :where(.nc-stack, .nc-cluster, .nc-with-sidebar, .nc-grid, .nc-gallery, .nc-switcher, .nc-ram-grid) {
251
+ :where(
252
+ .nc-stack,
253
+ .nc-cluster,
254
+ .nc-with-sidebar,
255
+ .nc-grid,
256
+ .nc-gallery,
257
+ .nc-switcher,
258
+ .nc-ram-grid
259
+ ) {
249
260
  &.-inherit {
250
261
  gap: inherit;
251
262
  }
@@ -28,7 +28,7 @@
28
28
 
29
29
  :where(:not(:active):focus-visible) {
30
30
  outline: var(--border-width-medium) solid var(--color-brand-primary-base);
31
- outline-offset: 1ch;
31
+ outline-offset: 0.5em;
32
32
  }
33
33
 
34
34
  :where(:focus:not(:focus-visible)) {
package/transform.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import browserslist from 'browserslist';
3
- import { browserslistToTargets, bundle, Features } from 'lightningcss';
3
+ import { browserslistToTargets, bundle } from 'lightningcss';
4
4
 
5
5
  const browserlistTargtsWidelyAvailable = [
6
6
  'Chrome > 0 and last 2.5 years',
@@ -15,44 +15,56 @@ const browserlistTargtsWidelyAvailable = [
15
15
 
16
16
  const targets = browserslistToTargets(browserslist(browserlistTargtsWidelyAvailable));
17
17
 
18
- const config = {
18
+ const { code: colors } = bundle({
19
+ // ...
19
20
  targets,
20
21
  drafts: {
21
22
  customMedia: true,
22
23
  },
23
- exclude: Features.LightDark
24
- };
25
-
26
- const { code: colors } = bundle({
27
- ...config,
28
24
  filename: 'src/styles/theme/colors.css',
29
25
  });
30
26
 
31
27
  fs.writeFileSync('out/colors.css', colors);
32
28
 
33
29
  const { code } = bundle({
34
- ...config,
30
+ // ...
31
+ targets,
32
+ drafts: {
33
+ customMedia: true,
34
+ },
35
35
  filename: 'src/styles/bundle.css',
36
36
  });
37
37
 
38
38
  fs.writeFileSync('out/bundle.css', code);
39
39
 
40
40
  const { code: bundleConfigless } = bundle({
41
- ...config,
41
+ // ...
42
+ targets,
43
+ drafts: {
44
+ customMedia: true,
45
+ },
42
46
  filename: 'src/styles/bundle_configless.css',
43
47
  });
44
48
 
45
49
  fs.writeFileSync('out/bundle_configless.css', bundleConfigless);
46
50
 
47
51
  const { code: codeComplete } = bundle({
48
- ...config,
52
+ // ...
53
+ targets,
54
+ drafts: {
55
+ customMedia: true,
56
+ },
49
57
  filename: 'src/styles/complete.css',
50
58
  });
51
59
 
52
60
  fs.writeFileSync('out/complete.css', codeComplete);
53
61
 
54
62
  const { code: codeCompleteConfigless } = bundle({
55
- ...config,
63
+ // ...
64
+ targets,
65
+ drafts: {
66
+ customMedia: true,
67
+ },
56
68
  filename: 'src/styles/complete_configless.css',
57
69
  });
58
70