Skip to content

Commit f30a28b

Browse files
committed
first commit
1 parent 9287b69 commit f30a28b

File tree

5 files changed

+146
-1
lines changed

5 files changed

+146
-1
lines changed

.eslintrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es6: true,
6+
},
7+
rules: {
8+
'brace-style': 'warn', // [1tbs default, stroustrup, allman]
9+
'comma-dangle': ['warn', 'always-multiline'],
10+
'indent': ['warn', 2],
11+
'no-unused-vars': 'warn',
12+
'quotes': ['warn', 'single', { avoidEscape: true }],
13+
'semi': ['warn', 'never'],
14+
15+
'array-bracket-spacing': ['warn', 'never'],
16+
'comma-spacing': ['warn', { before: false, after: true }],
17+
'key-spacing': ['warn'],
18+
'keyword-spacing': ['warn'],
19+
'no-multi-spaces': ['warn'],
20+
'no-trailing-spaces': ['warn'],
21+
'object-curly-spacing': ['warn', 'always'],
22+
'space-before-function-paren': ['warn', 'always'],
23+
'space-before-blocks': 'warn',
24+
'space-infix-ops': ['warn'],
25+
'space-in-parens': ['warn', 'never'],
26+
},
27+
globals: {
28+
process: true,
29+
},
30+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
yarn.lock
3+
package-lock.json

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
# tailwindcss-skeleton-screen
1+
# tailwindcss-skeleton-screen
2+
3+
Tailwindcss plugin to make skeleton screen easier than ever.
4+
5+
[Live Demo](https://jsfiddle.com)
6+
7+
## Installation
8+
9+
```sh
10+
# Using npm
11+
npm install -D @gradin/tailwindcss-skeleton-screen
12+
13+
# Using Yarn
14+
yarn add -D @gradin/tailwindcss-skeleton-screen
15+
```
16+
17+
Then add the plugin too `tailwind.config.js` file
18+
19+
```js
20+
module.exports = {
21+
theme: {
22+
// ...
23+
},
24+
plugins: [
25+
require('@gradints/tailwindcss-skeleton-screen'),
26+
// ...
27+
],
28+
}
29+
```

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@gradin/tailwindcss-skeleton-screen",
3+
"version": "0.0.1",
4+
"description": "Tailwindcss plugin to make skeleton screen easier than ever.",
5+
"main": "src/index.js",
6+
"scripts": {
7+
"prepublishOnly": "node scripts/build.js",
8+
"test": "jest"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/gradints/tailwindcss-skeleton-screen.git"
13+
},
14+
"keywords": [
15+
"tailwind",
16+
"tailwindcss",
17+
"skeleton screen",
18+
"loading",
19+
"animation"
20+
],
21+
"author": "Christhofer",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/gradints/tailwindcss-skeleton-screen/issues"
25+
},
26+
"homepage": "https://github.com/gradints/tailwindcss-skeleton-screen#readme",
27+
"devDependencies": {
28+
"clean-css": "^5.1.2",
29+
"eslint": "^7.24.0",
30+
"tailwindcss": "^2.1.1"
31+
}
32+
}

src/index.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const plugin = require('tailwindcss/plugin')
2+
3+
module.exports = plugin(
4+
function ({ addUtilities }) {
5+
addUtilities([
6+
{
7+
'.loading': {
8+
position: 'relative',
9+
overflow: 'hidden',
10+
backgroundColor: '#c7c7c7',
11+
},
12+
'.loading::after': {
13+
display: 'block',
14+
position: 'absolute',
15+
height: '100%',
16+
top: 0,
17+
left: '-10rem',
18+
width: '10rem',
19+
content: "''",
20+
background: 'linear-gradient(to right, transparent 0%, #E8E8E8 50%, transparent 100%)',
21+
animation: 'skeletonloading 1s cubic-bezier(0.4, 0.0, 0.2, 1) infinite',
22+
},
23+
'@keyframes skeletonloading': {
24+
from: {
25+
left: '-10rem',
26+
},
27+
to: {
28+
left: '100%',
29+
},
30+
},
31+
},
32+
])
33+
}
34+
)
35+
36+
// .loading {
37+
// @apply bg-gray-300 overflow-hidden relative;
38+
// &::after {
39+
// @apply block absolute h-full top-0 -left-40 w-40;
40+
// content: '';
41+
// background: linear-gradient(to right, transparent 0%, #E8E8E8 50%, transparent 100%);
42+
// animation: skeletonloading 1s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
43+
// }
44+
// }
45+
// @keyframes skeletonloading {
46+
// from {
47+
// @apply -left-40;
48+
// }
49+
// to {
50+
// @apply left-full;
51+
// }
52+
// }

0 commit comments

Comments
 (0)