nano-skeleton 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: link's skeleton and link's underline have different widths
8
+
9
+ ## 0.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - feat: RTL support
14
+
3
15
  ## 0.3.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A tiny, framework-agnostic skeleton loader built on Web Components.
4
4
 
5
+ **[Live demo](https://smashercosmo.github.io/nano-skeleton/)**
6
+
5
7
  Instead of maintaining a separate "loading" version of every component, wrap the
6
8
  pieces of your real UI in `<nano-skeleton>` and flip a single `loading` switch.
7
9
  The layout stays exactly where it is, nothing jumps, and the content is swapped
@@ -482,6 +484,12 @@ The default colors use `light-dark()`, so they follow the page's
482
484
  }
483
485
  ```
484
486
 
487
+ ### Right-to-left
488
+
489
+ The shimmer follows the reading direction: in right-to-left content, set with
490
+ `dir="rtl"` on the skeleton or any ancestor, it moves from right to left. A
491
+ custom `--nano-skeleton-animation` with its own keyframes isn't affected.
492
+
485
493
  ### Reduced motion
486
494
 
487
495
  The animation is disabled automatically for users with
package/dist/constants.js CHANGED
@@ -38,6 +38,7 @@ const e=`nano-skeleton`,t=`${e}-provider`,{default:n}={default:`:scope {
38
38
  var(--nano-skeleton-text-border-radius-default)
39
39
  );
40
40
  box-decoration-break: clone;
41
+ text-decoration-skip-ink: none;
41
42
  text-box: cap alphabetic;
42
43
  /**
43
44
  * This ensures the ellipsis on truncated text is also hidden.
@@ -86,12 +87,21 @@ const e=`nano-skeleton`,t=`${e}-provider`,{default:n}={default:`:scope {
86
87
  }
87
88
  }
88
89
 
90
+ /**
91
+ * The shimmer follows the reading direction
92
+ */
93
+ :scope[data-loading][data-text]:dir(rtl),
94
+ :scope[data-loading]:not([data-text]) > :dir(rtl) {
95
+ --nano-skeleton-shimmer-from: 0%;
96
+ --nano-skeleton-shimmer-to: 100%;
97
+ }
98
+
89
99
  @keyframes shimmer {
90
100
  from {
91
- background-position-x: 100%;
101
+ background-position-x: var(--nano-skeleton-shimmer-from, 100%);
92
102
  }
93
103
  to {
94
- background-position-x: 0;
104
+ background-position-x: var(--nano-skeleton-shimmer-to, 0%);
95
105
  }
96
106
  }
97
107
  `},r=Symbol.for(`${e}-context`);export{e as COMPONENT_NAME,n as CSS_CONTENT,t as PROVIDER_NAME,r as SKELETON_CONTEXT};
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["COMPONENT_NAME","PROVIDER_NAME","CSS_CONTENT","SKELETON_CONTEXT"],"sources":["../src/constants.ts"],"sourcesContent":["const isDev = import.meta.env.MODE !== \"production\";\n\nexport const COMPONENT_NAME = \"nano-skeleton\" as const;\n\nexport const PROVIDER_NAME = `${COMPONENT_NAME}-provider` as const;\n\nconst { default: CSS_CONTENT } = isDev\n ? await import(\"./styles.css?inline\")\n : { default: `__CSS_CONTENT__` };\n\nexport { CSS_CONTENT };\n\nexport const SKELETON_CONTEXT = Symbol.for(`${COMPONENT_NAME}-context`);\n"],"mappings":"AAEA,MAAaA,EAAiB,gBAEjBC,EAAgB,GAAGD,EAAe,WAEzC,CAAE,QAASE,GAEb,CAAE,QAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGb,EAIWC,EAAmB,OAAO,IAAI,GAAGH,EAAe,SAAS,E"}
1
+ {"version":3,"file":"constants.js","names":["COMPONENT_NAME","PROVIDER_NAME","CSS_CONTENT","SKELETON_CONTEXT"],"sources":["../src/constants.ts"],"sourcesContent":["const isDev = import.meta.env.MODE !== \"production\";\n\nexport const COMPONENT_NAME = \"nano-skeleton\" as const;\n\nexport const PROVIDER_NAME = `${COMPONENT_NAME}-provider` as const;\n\nconst { default: CSS_CONTENT } = isDev\n ? await import(\"./styles.css?inline\")\n : { default: `__CSS_CONTENT__` };\n\nexport { CSS_CONTENT };\n\nexport const SKELETON_CONTEXT = Symbol.for(`${COMPONENT_NAME}-context`);\n"],"mappings":"AAEA,MAAaA,EAAiB,gBAEjBC,EAAgB,GAAGD,EAAe,WAEzC,CAAE,QAASE,GAEb,CAAE,QAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Gb,EAIWC,EAAmB,OAAO,IAAI,GAAGH,EAAe,SAAS,E"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "nano-skeleton",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "The perfect skeleton component",
5
- "homepage": "https://github.com/smashercosmo/nano-skeleton#readme",
5
+ "homepage": "https://smashercosmo.github.io/nano-skeleton/",
6
6
  "bugs": {
7
7
  "url": "https://github.com/smashercosmo/nano-skeleton/issues"
8
8
  },