@nafisazizir/ziiz 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/package.json +1 -1
  3. package/theme.css +35 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @nafisazizir/ziiz
2
2
 
3
+ ## 0.1.1
4
+
5
+ - Squircle corners. `theme.css` sets `corner-shape` on every element, so
6
+ each `rounded-*` corner draws as a squircle in browsers that support
7
+ `corner-shape` and typed arithmetic. Others keep the round corner.
8
+ `rounded-full` and a `--radius` of 4rem or more (the
9
+ `[--radius:9999px]` pill) stay round. Write `[corner-shape:round]` to opt
10
+ one element out.
11
+ - `--radius-scale` multiplies the `rounded-*` scale. It is 1, and 1.4 where
12
+ squircles draw, because a squircle reads tighter than a round corner at
13
+ the same radius. Set it to 1 to keep the round radii under squircles.
14
+ - A rounder scale. The `sm` to `xl` multipliers on `--radius` are 1, 1.3,
15
+ 1.5 and 1.6 (they were 0.6, 0.8, 1 and 1.4): 19.6, 25.5, 29.4 and
16
+ 31.4px where squircles draw. Buttons, fields, tabs and menu items from
17
+ 24px to 40px tall now draw as capsules. `2xl` to `4xl` are unchanged.
18
+ - The radius caps in Button, Checkbox, InputGroup, Kbd, Nav and
19
+ Questionnaire (`rounded-[min(var(--radius-md),10px)]` and the like), and
20
+ Sonner's toast radius, follow `--radius-scale`. Components installed
21
+ earlier keep their unscaled caps.
22
+ - Badge now uses `rounded-full`. A Badge installed earlier still has
23
+ `rounded-4xl` and draws a squircle capsule; change it to `rounded-full`
24
+ for round ends.
25
+ - `background-200` sits closer to `background-100` in light mode and
26
+ lifts off it in dark: `oklch(0.991 0 0)`, `#fcfcfc` (was `0.984`,
27
+ `#fafafa`), and `oklch(0.134 0 0)`, `#080808` (was `0.027`, which
28
+ rounds to `#000000` and drew no lift at all).
29
+
3
30
  ## 0.1.0
4
31
 
5
32
  First release, a beta preview. Expect breaking changes in 0.x minors.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nafisazizir/ziiz",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "ziiz design layer: ramp tokens, type roles, materials, prose, Shiki, and the shadcn slot bridge.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/theme.css CHANGED
@@ -15,14 +15,15 @@
15
15
  @theme inline {
16
16
  --font-heading: var(--font-sans);
17
17
 
18
- /* Multiplicative radius scale off --radius; materials pin onto it. */
19
- --radius-sm: calc(var(--radius) * 0.6);
20
- --radius-md: calc(var(--radius) * 0.8);
21
- --radius-lg: var(--radius);
22
- --radius-xl: calc(var(--radius) * 1.4);
23
- --radius-2xl: calc(var(--radius) * 1.8);
24
- --radius-3xl: calc(var(--radius) * 2.2);
25
- --radius-4xl: calc(var(--radius) * 2.6);
18
+ /* Multiplicative radius scale off --radius; materials pin onto it.
19
+ --radius-scale grows it where corners draw as squircles. */
20
+ --radius-sm: calc(var(--radius) * var(--radius-scale));
21
+ --radius-md: calc(var(--radius) * 1.3 * var(--radius-scale));
22
+ --radius-lg: calc(var(--radius) * 1.5 * var(--radius-scale));
23
+ --radius-xl: calc(var(--radius) * 1.6 * var(--radius-scale));
24
+ --radius-2xl: calc(var(--radius) * 1.8 * var(--radius-scale));
25
+ --radius-3xl: calc(var(--radius) * 2.2 * var(--radius-scale));
26
+ --radius-4xl: calc(var(--radius) * 2.6 * var(--radius-scale));
26
27
  }
27
28
 
28
29
  /* ziiz theme tokens */
@@ -149,10 +150,11 @@
149
150
 
150
151
  :root {
151
152
  --radius: 0.875rem;
153
+ --radius-scale: 1;
152
154
  --ds-black: oklch(0 0 0);
153
155
  --ds-white: oklch(1 0 0);
154
156
  --ds-background-100: oklch(1 0 0);
155
- --ds-background-200: oklch(0.984 0 0);
157
+ --ds-background-200: oklch(0.991 0 0);
156
158
  --ds-gray-100: oklch(0.961 0 0);
157
159
  --ds-gray-200: oklch(0.94 0 0);
158
160
  --ds-gray-300: oklch(0.925 0 0);
@@ -303,7 +305,7 @@
303
305
 
304
306
  .dark {
305
307
  --ds-background-100: oklch(0 0 0);
306
- --ds-background-200: oklch(0.027 0 0);
308
+ --ds-background-200: oklch(0.134 0 0);
307
309
  --ds-gray-100: oklch(0.218 0 0);
308
310
  --ds-gray-200: oklch(0.239 0 0);
309
311
  --ds-gray-300: oklch(0.281 0 0);
@@ -453,6 +455,15 @@
453
455
  0 0 0 2px var(--ds-background-100), 0 0 0 4px var(--ds-blue-900);
454
456
  }
455
457
 
458
+ /* A squircle reads tighter than a round corner at the same radius, so the
459
+ scale grows where squircles draw. The condition matches the corner-shape
460
+ rule below: corner-shape plus typed arithmetic. */
461
+ @supports (corner-shape: superellipse(calc(2px / 1px))) {
462
+ :root {
463
+ --radius-scale: 1.4;
464
+ }
465
+ }
466
+
456
467
  /* Shiki syntax highlighting palette */
457
468
  :root {
458
469
  --shiki-color-text: var(--ds-gray-1000);
@@ -472,6 +483,13 @@
472
483
  * {
473
484
  @apply border-gray-alpha-400 outline-gray-600/50;
474
485
  }
486
+ /* Squircle corners where supported, round elsewhere. A --radius of 4rem
487
+ or more is a pill, which stays round. */
488
+ *,
489
+ ::before,
490
+ ::after {
491
+ corner-shape: superellipse(clamp(1, 1 + (4rem - var(--radius)) / 1px, 2));
492
+ }
475
493
  body {
476
494
  @apply bg-background-100 text-gray-1000;
477
495
  }
@@ -490,6 +508,11 @@
490
508
  }
491
509
  }
492
510
 
511
+ /* A squircle turns a circle into a rounded square; full stays round. */
512
+ @utility rounded-full {
513
+ corner-shape: round;
514
+ }
515
+
493
516
  /* Material */
494
517
 
495
518
  @utility material-base {
@@ -922,7 +945,7 @@
922
945
  /* Keyboard keys. */
923
946
  /* Keyboard keys, matching the ui Kbd component. */
924
947
  &:where(kbd) {
925
- @apply inline-flex h-5 min-w-5 items-center justify-center rounded-[min(var(--radius-sm),6px)] bg-gray-100 px-1 text-label-12 text-gray-900;
948
+ @apply inline-flex h-5 min-w-5 items-center justify-center rounded-[min(var(--radius-sm),calc(6px*var(--radius-scale)))] bg-gray-100 px-1 text-label-12 text-gray-900;
926
949
  }
927
950
 
928
951
  /* Definition lists. */
@@ -946,7 +969,7 @@
946
969
 
947
970
  /* Inline code. */
948
971
  &:where(:not(pre) > code) {
949
- @apply rounded-[min(var(--radius-sm),6px)] bg-gray-100 text-copy-13-mono;
972
+ @apply rounded-[min(var(--radius-sm),calc(6px*var(--radius-scale)))] bg-gray-100 text-copy-13-mono;
950
973
  padding: 0.125rem 0.25rem;
951
974
  }
952
975