Skip to content

Commit d9f88d9

Browse files
committed
update README
1 parent b1b27e8 commit d9f88d9

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ return (
235235
</td>
236236
<td><code>true</code></td>
237237
</tr>
238+
<tr>
239+
<td><code>customHighlightBackground?: string</code></td>
240+
<td>
241+
Allows you to override the <code>background-image</code> property of the highlight element, enabling you to fully customize the gradient. See example below.
242+
</td>
243+
<td><code>undefined</code></td>
244+
</tr>
238245
</tbody>
239246
</table>
240247

@@ -273,6 +280,18 @@ const wrapped2 = (
273280
);
274281
```
275282

283+
### Custom Highlight Background
284+
285+
You may want to make the gradient used in the highlight element narrower or wider. To do this, you can set the `customHighlightBackground` prop. Here's an example of a narrow highlight:
286+
287+
```tsx
288+
<Skeleton customHighlightBackground="linear-gradient(90deg, var(--base-color) 40%, var(--highlight-color) 50%, var(--base-color) 60%)" />
289+
```
290+
291+
**If you use this prop, the `baseColor` and `highlightColor` props are ignored,** but you can still reference their corresponding CSS variables as shown in the above example.
292+
293+
![Custom highlight background example](assets/custom-highlight-background.png)
294+
276295
## Troubleshooting
277296

278297
### The skeleton width is 0 when the parent has `display: flex`!

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"jsx": "react",
66

77
/* Modules */
8-
"module": "ESNext",
8+
"module": "nodenext",
99
"moduleResolution": "nodenext",
1010

1111
/* Emit */

0 commit comments

Comments
 (0)