nano-skeleton 0.3.0 → 0.4.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 +6 -0
- package/README.md +8 -0
- package/dist/constants.js +11 -2
- package/dist/constants.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
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
|
@@ -86,12 +86,21 @@ const e=`nano-skeleton`,t=`${e}-provider`,{default:n}={default:`:scope {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* The shimmer follows the reading direction
|
|
91
|
+
*/
|
|
92
|
+
:scope[data-loading][data-text]:dir(rtl),
|
|
93
|
+
:scope[data-loading]:not([data-text]) > :dir(rtl) {
|
|
94
|
+
--nano-skeleton-shimmer-from: 0%;
|
|
95
|
+
--nano-skeleton-shimmer-to: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
89
98
|
@keyframes shimmer {
|
|
90
99
|
from {
|
|
91
|
-
background-position-x: 100
|
|
100
|
+
background-position-x: var(--nano-skeleton-shimmer-from, 100%);
|
|
92
101
|
}
|
|
93
102
|
to {
|
|
94
|
-
background-position-x: 0;
|
|
103
|
+
background-position-x: var(--nano-skeleton-shimmer-to, 0%);
|
|
95
104
|
}
|
|
96
105
|
}
|
|
97
106
|
`},r=Symbol.for(`${e}-context`);export{e as COMPONENT_NAME,n as CSS_CONTENT,t as PROVIDER_NAME,r as SKELETON_CONTEXT};
|
package/dist/constants.js.map
CHANGED
|
@@ -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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGb,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
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The perfect skeleton component",
|
|
5
|
-
"homepage": "https://github.
|
|
5
|
+
"homepage": "https://smashercosmo.github.io/nano-skeleton/",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/smashercosmo/nano-skeleton/issues"
|
|
8
8
|
},
|