@domandigital/craft 0.1.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @domandigital/craft
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6462b3a: Use the `text-wrap-style` longhand, and stop applying orphan control to every
8
+ `li`.
9
+
10
+ `text-wrap` is shorthand for `text-wrap-mode` + `text-wrap-style`, so
11
+ `text-wrap: pretty` silently resets the mode to `wrap`. `white-space: nowrap` is
12
+ itself shorthand setting `text-wrap-mode: nowrap`, so the shorthand defeated it
13
+ along with any `text-overflow: ellipsis` truncation that relied on it.
14
+
15
+ Caught by a visual regression suite: `li { text-wrap: pretty }` expanded a
16
+ breadcrumb that truncates to one line into three lines and pushed the page 40px
17
+ taller. The longhand sets only the style, so an element that asked not to wrap
18
+ still does not.
19
+
20
+ `li` is now scoped to `.craft-prose li`. Breadcrumbs, navs, tab strips and menus
21
+ are all `li` and none of them are body copy.
22
+
3
23
  ## 0.1.0
4
24
 
5
25
  ### Minor Changes
package/css/craft.css CHANGED
@@ -21,6 +21,25 @@ html {
21
21
  text-rendering: optimizeLegibility;
22
22
  }
23
23
 
24
+ /*
25
+ * THE LONGHAND, NOT `text-wrap`. This matters.
26
+ *
27
+ * `text-wrap` is a shorthand for `text-wrap-mode` + `text-wrap-style`, so
28
+ * `text-wrap: pretty` silently resets the MODE to `wrap`. `white-space: nowrap`
29
+ * is itself shorthand for `white-space-collapse: collapse` + `text-wrap-mode:
30
+ * nowrap`, so any element the shorthand touches loses its nowrap — and with it
31
+ * any `text-overflow: ellipsis` truncation that depended on it.
32
+ *
33
+ * That is not hypothetical: `li { text-wrap: pretty }` broke a breadcrumb that
34
+ * truncates to one line, expanding it to three and pushing the page 40px taller.
35
+ * `text-wrap-style` sets only the style and leaves the mode alone, so an element
36
+ * that asked not to wrap still does not.
37
+ *
38
+ * Browsers without `text-wrap-style` simply get no orphan control, which is the
39
+ * correct degradation. A `text-wrap` shorthand fallback would reintroduce the
40
+ * bug, so there deliberately isn't one.
41
+ */
42
+
24
43
  /* A heading that wraps one word onto its own line looks like a mistake.
25
44
  `balance` evens the lines; it is capped at ~6 lines by the spec, which is why
26
45
  it is scoped to headings and not applied to body copy. */
@@ -31,16 +50,22 @@ h4,
31
50
  h5,
32
51
  h6,
33
52
  .craft-balance {
34
- text-wrap: balance;
53
+ text-wrap-style: balance;
35
54
  }
36
55
 
37
- /* `pretty` is the body-copy counterpart: it only prevents orphans, so it stays
38
- cheap on long text where `balance` would not. */
56
+ /*
57
+ * `pretty` is the body-copy counterpart: it only prevents orphans, so it stays
58
+ * cheap on long text where `balance` would not.
59
+ *
60
+ * `li` is deliberately scoped to prose. Breadcrumbs, navs, tab strips and menus
61
+ * are all `li` and none of them are body copy; orphan control there is at best
62
+ * meaningless and at worst fights a deliberate truncation.
63
+ */
39
64
  p,
40
- li,
41
65
  figcaption,
42
- blockquote {
43
- text-wrap: pretty;
66
+ blockquote,
67
+ .craft-prose li {
68
+ text-wrap-style: pretty;
44
69
  }
45
70
 
46
71
  .craft-prose {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domandigital/craft",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "description": "The Doman Digital house craft standard as numbers: OKLCh colour ramps that snap to existing anchors, derived semantic tokens with measured WCAG and APCA contrast, one shared motion vocabulary for CSS and JS, and a base stylesheet. Zero dependencies.",
6
6
  "license": "Apache-2.0",
@@ -30,12 +30,6 @@
30
30
  "css",
31
31
  "dist"
32
32
  ],
33
- "scripts": {
34
- "build": "tsup src/index.ts --format cjs,esm --dts --clean",
35
- "typecheck": "tsc --noEmit",
36
- "test": "vitest run",
37
- "prepublishOnly": "pnpm run build"
38
- },
39
33
  "devDependencies": {
40
34
  "tsup": "^8.3.5",
41
35
  "typescript": "^5.6.3",
@@ -44,7 +38,6 @@
44
38
  "engines": {
45
39
  "node": ">=20"
46
40
  },
47
- "packageManager": "pnpm@9.15.9",
48
41
  "repository": {
49
42
  "type": "git",
50
43
  "url": "git+https://github.com/Doman-Digital/dd-packages.git",
@@ -57,5 +50,10 @@
57
50
  "publishConfig": {
58
51
  "access": "public",
59
52
  "provenance": true
53
+ },
54
+ "scripts": {
55
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean",
56
+ "typecheck": "tsc --noEmit",
57
+ "test": "vitest run"
60
58
  }
61
- }
59
+ }