@camp.dev/bones 0.4.0 → 0.4.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.
package/README.md CHANGED
@@ -133,7 +133,7 @@ Set `aria-busy="true"` on the loading region and every unmarked leaf inside it b
133
133
  </section>
134
134
  ```
135
135
 
136
- `[data-bones-auto="off"]` opts a subtree out — useful for a status message you want to stay readable while its container skeletonizes. Explicit `data-bone` markup is left alone; `auto.css` only styles elements neither `bone()` nor a manual `data-bone` attribute has already claimed.
136
+ `[data-bones-auto="off"]` opts a subtree out — useful for a status message you want to stay readable while its container skeletonizes. Images, canvas, and video without native controls get a solid bone even after they have loaded, unless page CSS sets `object-position` on them, which outranks the layered rule the same way `color` does. A loaded `iframe`, `embed`, or `object` still shows its content, because those elements ignore `object-position`. Explicit `data-bone` markup is left alone; `auto.css` only styles elements neither `bone()` nor a manual `data-bone` attribute has already claimed.
137
137
 
138
138
  Auto rules live in `@layer bones-auto`, so any page CSS that sets `color` on an element outranks the bone's transparent text, and that text stays visible over its skeleton bar. `data-bone-animate` works on the `aria-busy` element itself or on any ancestor. The `data-bone-animate` overrides rely on `@scope`. In a browser without `@scope`, every bone shimmers, and `data-bone-animate="pulse"` and `"none"` cannot change that. The `prefers-reduced-motion` fallback to pulse still applies.
139
139
 
package/dist/css/auto.css CHANGED
@@ -148,6 +148,17 @@
148
148
  background-color: var(--bone-base);
149
149
  border-radius: var(--bone-radius);
150
150
  border-color: transparent;
151
+ /* A loaded image paints over its own background, so the bone color alone
152
+ does not cover it. Pushing the picture out of its content box leaves
153
+ the box and its background in place (BON-15). Only img, video, and
154
+ canvas honor this; a loaded iframe, embed, or object still shows, and
155
+ native video controls paint over the bone. object-position is
156
+ interpolable, so a page `transition: all` on images would slide the
157
+ picture out over the transition's duration; transition: none stops
158
+ that on the way in. On the way out the page's own transition applies,
159
+ and the picture reappears at the end of it instead of the start. */
160
+ object-position: 9999px 0;
161
+ transition: none;
151
162
  }
152
163
 
153
164
  /* Width variance: text leaves cycle 85 / 100 / 92 / 60 so runs of lines
@@ -70,8 +70,15 @@
70
70
  }
71
71
 
72
72
  img[data-bone="block"],
73
- video[data-bone="block"] {
73
+ video[data-bone="block"],
74
+ canvas[data-bone="block"] {
74
75
  color: rgb(from currentcolor r g b / 0);
76
+ /* A loaded picture paints over the bone's background-color; pushing it out
77
+ of the content box keeps the box and background visible (BON-15).
78
+ transition: none keeps a page `transition: all` from sliding the picture
79
+ out on the way in; see the matching comment in auto.css. */
80
+ object-position: 9999px 0;
81
+ transition: none;
75
82
  }
76
83
 
77
84
  [data-bone="container"] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camp.dev/bones",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Skeleton loaders designed for React Server Components and streaming.",
5
5
  "homepage": "https://github.com/campdotdev/bones#readme",
6
6
  "bugs": {
package/src/css/auto.css CHANGED
@@ -148,6 +148,17 @@
148
148
  background-color: var(--bone-base);
149
149
  border-radius: var(--bone-radius);
150
150
  border-color: transparent;
151
+ /* A loaded image paints over its own background, so the bone color alone
152
+ does not cover it. Pushing the picture out of its content box leaves
153
+ the box and its background in place (BON-15). Only img, video, and
154
+ canvas honor this; a loaded iframe, embed, or object still shows, and
155
+ native video controls paint over the bone. object-position is
156
+ interpolable, so a page `transition: all` on images would slide the
157
+ picture out over the transition's duration; transition: none stops
158
+ that on the way in. On the way out the page's own transition applies,
159
+ and the picture reappears at the end of it instead of the start. */
160
+ object-position: 9999px 0;
161
+ transition: none;
151
162
  }
152
163
 
153
164
  /* Width variance: text leaves cycle 85 / 100 / 92 / 60 so runs of lines
package/src/css/bones.css CHANGED
@@ -70,8 +70,15 @@
70
70
  }
71
71
 
72
72
  img[data-bone="block"],
73
- video[data-bone="block"] {
73
+ video[data-bone="block"],
74
+ canvas[data-bone="block"] {
74
75
  color: rgb(from currentcolor r g b / 0);
76
+ /* A loaded picture paints over the bone's background-color; pushing it out
77
+ of the content box keeps the box and background visible (BON-15).
78
+ transition: none keeps a page `transition: all` from sliding the picture
79
+ out on the way in; see the matching comment in auto.css. */
80
+ object-position: 9999px 0;
81
+ transition: none;
75
82
  }
76
83
 
77
84
  [data-bone="container"] {