Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/t4y3/tailwindcss-skeleton-screen

Just add the class. Not by width or height, but by number of characters.
https://github.com/t4y3/tailwindcss-skeleton-screen

skeleton-screen tailwindcss

Last synced: about 1 month ago
JSON representation

Just add the class. Not by width or height, but by number of characters.

Awesome Lists containing this project

README

        

# tailwindcss-skeleton-screen
Just add the class. Not by width or height, but by number of characters.

![](.github/main.png)

## Concept

`As close as possible to normal markup`

Skeleton display is performed only when there are no children.
Just add the class of `ss-text-[n]`.

```jsx
{/* Skeleton displayed only if empty */}

{text}


```

### Differences from Others

![](.github/diff_others.png)

[PR for checking diff](https://github.com/t4y3/tailwindcss-skeleton-screen/pull/2/files)

### Number of characters, not Height and width
```html


```

```html
<-- 😍 -->


```

### Wrapping of long sentences is also supported
```html





```

```html
<-- 😍 -->


```

## Installation
Install the plugin from npm:

```shell
npm install -D tailwindcss-skeleton-screen
```

Then add the plugin to your tailwind.config.js file:

```js
/** @type {import('tailwindcss').Config} */
module.exports = {
theme: {
extend: {
skeletonScreen: {
color: '#d0d0d0', // optional
borderRadius: "4px" // optional
}
}
},
plugins: [
require('tailwindcss-skeleton-screen')
]
};

```

## Basic usage
- Only the number of characters is specified.
- The height can be changed by font-size and light-height, so there is no need to specify it for skeleton.

| class | |
|-----------------|---|
| ss-object | Display skeleton with background-color |
| ss-text-[n] | Display skeleton for n characters |
| ss-text-[n/n/n] | The number of characters per line can be specified by separating each line with a "slash (/)". |