Skip to content

Commit 41c7438

Browse files
committed
docs: Build pages
1 parent bcd3889 commit 41c7438

File tree

5 files changed

+43
-4
lines changed

5 files changed

+43
-4
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,20 @@ jobs:
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
deploy:
53+
name: Deploy
54+
runs-on: ubuntu-latest
55+
if: github.ref == 'refs/heads/master'
56+
57+
steps:
58+
- name: 'Install depependencies'
59+
run: |
60+
npm install --force
61+
- name: 'Build docs'
62+
run: |
63+
npm run build_docs
64+
- name: Deploy to GitHub Pages
65+
uses: peaceiris/actions-gh-pages@v4
66+
with:
67+
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
publish_dir: ./dist

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Demo - https://unlight.github.io/tailwind-float-label
1717
<form class="max-w-xs mx-auto p-5 space-y-4">
1818
<h2 class="text-2xl font-bold text-center">Example</h2>
1919
<div class="float-container">
20-
<label for="name" class="float-label-self bg-white text-gray-500"
20+
<label for="name" class="float-label px-2 bg-white text-gray-500"
2121
>Name</label
2222
>
2323
<input
@@ -31,6 +31,8 @@ Demo - https://unlight.github.io/tailwind-float-label
3131
</form>
3232
```
3333

34+
If you need animation, add to `.float-label` following classes: `transition-all duration-200`
35+
3436
## Similar Projects
3537

3638
- https://github.com/notiz-dev/floating-form-field-tailwindcss

Taskfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ build() {
1212
set +x
1313
}
1414

15+
build_docs() {
16+
vite build
17+
}
18+
1519
"$@"

index.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
1313

1414
<form class="space-y-4">
1515
<div class="float-container">
16-
<label for="name" class="float-label px-2 text-gray-600"
16+
<label for="fullname" class="float-label px-2 text-gray-600"
1717
>Full Name (1: empty)</label
1818
>
1919
<input
2020
type="text"
21-
id="name"
21+
id="fullname"
2222
class="float-input w-full px-3 py-2 border border-gray-300"
2323
placeholder="Full Name placeholder"
2424
/>
@@ -80,6 +80,21 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
8080
Submit
8181
</button>
8282
</form>
83+
<form class="max-w-xs mx-auto p-5 space-y-4">
84+
<h2 class="text-2xl font-bold text-center">README Example</h2>
85+
<div class="float-container">
86+
<label for="name" class="float-label px-1 bg-white text-gray-500"
87+
>Name</label
88+
>
89+
<input
90+
type="text"
91+
id="name"
92+
autocomplete="off"
93+
placeholder="Name"
94+
class="float-input outline-none focus:shadow-outline border w-full px-1"
95+
/>
96+
</div>
97+
</form>
8398
</div>
8499
</body>
85100
</html>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"test": "echo no tests",
2424
"tscheck": "echo tscheck... && tsc --noEmit",
2525
"tscheck:w": "npm run tscheck -- --watch",
26-
"build": "sh Taskfile build"
26+
"build": "sh Taskfile build",
27+
"build_docs": "sh Taskfile build_docs"
2728
},
2829
"repository": {
2930
"type": "git",

0 commit comments

Comments
 (0)