@camp.dev/bones 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/README.md +138 -0
- package/dist/core/attributes.d.mts +25 -0
- package/dist/core/attributes.mjs +36 -0
- package/dist/css/auto.css +1092 -0
- package/dist/css/bones.css +156 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +2 -0
- package/dist/react/bones.d.mts +15 -0
- package/dist/react/bones.mjs +27 -0
- package/dist/react/create-bones.d.mts +23 -0
- package/dist/react/create-bones.mjs +73 -0
- package/dist/react/index.d.mts +4 -0
- package/dist/react/index.mjs +4 -0
- package/package.json +71 -0
- package/src/css/auto.css +1092 -0
- package/src/css/bones.css +156 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--bone-base: rgba(0, 0, 0, 0.12);
|
|
3
|
+
--bone-highlight: rgba(0, 0, 0, 0.06);
|
|
4
|
+
--bone-radius: 4px;
|
|
5
|
+
--bone-duration: 1.5s;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@media (prefers-color-scheme: dark) {
|
|
9
|
+
:root {
|
|
10
|
+
--bone-base: rgba(255, 255, 255, 0.12);
|
|
11
|
+
--bone-highlight: rgba(255, 255, 255, 0.06);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[data-bone="text"] {
|
|
16
|
+
color: transparent;
|
|
17
|
+
position: relative;
|
|
18
|
+
min-width: 4ch;
|
|
19
|
+
min-height: 1lh;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-bone-line] {
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-bone-line]:last-child {
|
|
27
|
+
width: 69%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[data-bone="text"]::before {
|
|
31
|
+
content: "\200b";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-bone="text"]::after {
|
|
35
|
+
content: "";
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset-inline: 0;
|
|
38
|
+
top: calc((1lh + 1cap) / 2 - 1ex);
|
|
39
|
+
height: 1ex;
|
|
40
|
+
background-color: var(--bone-base);
|
|
41
|
+
border-radius: var(--bone-radius);
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-bone="text"][style*="--bone-length"] {
|
|
46
|
+
width: calc(var(--bone-length) * 1ch);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-bone="text"][style*="--bone-contained"] {
|
|
50
|
+
min-width: unset;
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
box-sizing: content-box;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-bone="text"][style*="--bone-contained"]::after {
|
|
57
|
+
flex: 1;
|
|
58
|
+
position: static;
|
|
59
|
+
inset-inline: unset;
|
|
60
|
+
top: unset;
|
|
61
|
+
transform: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-bone="text"][style*="--bone-contained"][style*="--bone-length"] {
|
|
65
|
+
min-width: calc(var(--bone-length) * 1ch);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-bone="block"] {
|
|
69
|
+
display: inline-block;
|
|
70
|
+
background-color: var(--bone-base);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
img[data-bone="block"],
|
|
74
|
+
video[data-bone="block"] {
|
|
75
|
+
color: transparent;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[data-bone="container"] {
|
|
79
|
+
position: relative;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[data-bone="container"]::before {
|
|
84
|
+
content: "";
|
|
85
|
+
position: absolute;
|
|
86
|
+
inset: 0;
|
|
87
|
+
background-color: var(--bone-base);
|
|
88
|
+
z-index: 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-bone="container"] > * {
|
|
92
|
+
visibility: hidden;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@keyframes bone-shimmer {
|
|
96
|
+
0% {
|
|
97
|
+
background-position: 200% 0;
|
|
98
|
+
}
|
|
99
|
+
100% {
|
|
100
|
+
background-position: -200% 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@keyframes bone-pulse {
|
|
105
|
+
0%,
|
|
106
|
+
100% {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
}
|
|
109
|
+
50% {
|
|
110
|
+
opacity: 0.5;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@scope ([data-bone-animate="shimmer"]) to ([data-bone-animate]:not([data-bone-animate="shimmer"])) {
|
|
115
|
+
[data-bone="text"]::after,
|
|
116
|
+
[data-bone="text"]::before,
|
|
117
|
+
[data-bone="block"],
|
|
118
|
+
[data-bone="container"]::before {
|
|
119
|
+
animation: bone-shimmer var(--bone-duration) ease-in-out infinite;
|
|
120
|
+
background: linear-gradient(
|
|
121
|
+
90deg,
|
|
122
|
+
var(--bone-base) 25%,
|
|
123
|
+
var(--bone-highlight) 50%,
|
|
124
|
+
var(--bone-base) 75%
|
|
125
|
+
);
|
|
126
|
+
background-size: 200% 100%;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@scope ([data-bone-animate="pulse"]) to ([data-bone-animate]:not([data-bone-animate="pulse"])) {
|
|
131
|
+
[data-bone="text"]::after,
|
|
132
|
+
[data-bone="text"]::before,
|
|
133
|
+
[data-bone="block"],
|
|
134
|
+
[data-bone="container"]::before {
|
|
135
|
+
animation: bone-pulse var(--bone-duration) ease-in-out infinite;
|
|
136
|
+
background: var(--bone-base);
|
|
137
|
+
background-size: auto;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@scope ([data-bone-animate="none"]) to ([data-bone-animate]:not([data-bone-animate="none"])) {
|
|
142
|
+
[data-bone="text"]::after,
|
|
143
|
+
[data-bone="text"]::before,
|
|
144
|
+
[data-bone="block"],
|
|
145
|
+
[data-bone="container"]::before {
|
|
146
|
+
animation: none;
|
|
147
|
+
background: var(--bone-base);
|
|
148
|
+
background-size: auto;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@media (prefers-reduced-motion: reduce) {
|
|
153
|
+
[aria-busy="true"] {
|
|
154
|
+
animation: bone-pulse 2s ease-in-out infinite;
|
|
155
|
+
}
|
|
156
|
+
}
|