tailwindcss-forms-style 0.1.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/.github/ISSUE_TEMPLATE/1.bug_report.yml +38 -0
- package/.github/ISSUE_TEMPLATE/config.yml +11 -0
- package/.github/workflows/prepare-release.yml +56 -0
- package/.github/workflows/release-insiders.yml +42 -0
- package/.github/workflows/release.yml +42 -0
- package/CHANGELOG.md +201 -0
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/index.html +255 -0
- package/kitchen-sink.html +222 -0
- package/package.json +44 -0
- package/scripts/release-channel.js +18 -0
- package/scripts/release-notes.js +21 -0
- package/src/index.d.ts +9 -0
- package/src/index.js +368 -0
- package/tailwind.config.js +9 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Create a bug report for tailwindcss-forms-style.
|
|
3
|
+
labels: []
|
|
4
|
+
body:
|
|
5
|
+
- type: input
|
|
6
|
+
attributes:
|
|
7
|
+
label: What version of tailwindcss-forms-style are you using?
|
|
8
|
+
description: 'For example: v0.1.4'
|
|
9
|
+
validations:
|
|
10
|
+
required: true
|
|
11
|
+
- type: input
|
|
12
|
+
attributes:
|
|
13
|
+
label: What version of Node.js are you using?
|
|
14
|
+
description: 'For example: v12.0.0'
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: input
|
|
18
|
+
attributes:
|
|
19
|
+
label: What browser are you using?
|
|
20
|
+
description: 'For example: Chrome, Safari, or N/A'
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: input
|
|
24
|
+
attributes:
|
|
25
|
+
label: What operating system are you using?
|
|
26
|
+
description: 'For example: macOS, Windows'
|
|
27
|
+
validations:
|
|
28
|
+
required: true
|
|
29
|
+
- type: input
|
|
30
|
+
attributes:
|
|
31
|
+
label: Reproduction repository
|
|
32
|
+
description: A public GitHub repo that includes a minimal reproduction of the bug. Unfortunately we can't provide support without a reproduction, and your issue will be closed and locked with no comment if this is not provided.
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
- type: textarea
|
|
36
|
+
attributes:
|
|
37
|
+
label: Describe your issue
|
|
38
|
+
description: Describe the problem you're seeing, any important steps to reproduce and what behavior you expect instead
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Feature Request
|
|
4
|
+
url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=ideas
|
|
5
|
+
about: 'Suggest any ideas you have using our discussion forums.'
|
|
6
|
+
- name: Help
|
|
7
|
+
url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=help
|
|
8
|
+
about: 'If you have a question or need help, ask a question on the discussion forums.'
|
|
9
|
+
- name: Kind Words
|
|
10
|
+
url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=kind-words
|
|
11
|
+
about: "Have something nice to say about tailwindcss-forms-style or Tailwind CSS in general? We'd love to hear it!"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Prepare Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- 'v*'
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
prepare:
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write # for softprops/action-gh-release to create GitHub release
|
|
16
|
+
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
node-version: [22]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ matrix.node-version }}
|
|
30
|
+
registry-url: 'https://registry.npmjs.org'
|
|
31
|
+
cache: 'npm'
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: npm install
|
|
35
|
+
|
|
36
|
+
- name: Test
|
|
37
|
+
run: npm test
|
|
38
|
+
|
|
39
|
+
- name: Resolve version
|
|
40
|
+
id: vars
|
|
41
|
+
run: |
|
|
42
|
+
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
43
|
+
|
|
44
|
+
- name: Get release notes
|
|
45
|
+
run: |
|
|
46
|
+
RELEASE_NOTES=$(npm run release-notes --silent)
|
|
47
|
+
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
|
|
48
|
+
echo "$RELEASE_NOTES" >> $GITHUB_ENV
|
|
49
|
+
echo "EOF" >> $GITHUB_ENV
|
|
50
|
+
|
|
51
|
+
- name: Release
|
|
52
|
+
uses: softprops/action-gh-release@v1
|
|
53
|
+
with:
|
|
54
|
+
draft: true
|
|
55
|
+
tag_name: ${{ env.TAG_NAME }}
|
|
56
|
+
body: ${{ env.RELEASE_NOTES }}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Release Insiders
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
node-version: [22]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node-version }}
|
|
26
|
+
registry-url: 'https://registry.npmjs.org'
|
|
27
|
+
cache: 'npm'
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: npm install
|
|
31
|
+
|
|
32
|
+
- name: Resolve version
|
|
33
|
+
id: vars
|
|
34
|
+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
35
|
+
|
|
36
|
+
- name: 'Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}'
|
|
37
|
+
run: npm version 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version
|
|
38
|
+
|
|
39
|
+
- name: Publish
|
|
40
|
+
run: npm publish --provenance --tag insiders
|
|
41
|
+
env:
|
|
42
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
node-version: [22]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node-version }}
|
|
26
|
+
registry-url: 'https://registry.npmjs.org'
|
|
27
|
+
cache: 'npm'
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: npm install
|
|
31
|
+
|
|
32
|
+
- name: Test
|
|
33
|
+
run: npm test
|
|
34
|
+
|
|
35
|
+
- name: Calculate environment variables
|
|
36
|
+
run: |
|
|
37
|
+
echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
|
|
38
|
+
|
|
39
|
+
- name: Publish
|
|
40
|
+
run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }}
|
|
41
|
+
env:
|
|
42
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
- Nothing yet!
|
|
11
|
+
|
|
12
|
+
## [0.5.11] - 2025-12-17
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Limit attribute rules to input and select elements ([#159](https://github.com/tailwindlabs/tailwindcss-forms/pull/159))
|
|
17
|
+
|
|
18
|
+
## [0.5.10] - 2025-01-07
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Support installing with beta versions of Tailwind CSS v4 ([#163](https://github.com/tailwindlabs/tailwindcss-forms/pull/163))
|
|
23
|
+
|
|
24
|
+
## [0.5.9] - 2024-09-05
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Fallback to static chevron color if theme is using variables ([#167](https://github.com/tailwindlabs/tailwindcss-forms/pull/167))
|
|
29
|
+
|
|
30
|
+
## [0.5.8] - 2024-08-28
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- Support installing with alpha versions of Tailwind CSS v4 ([#163](https://github.com/tailwindlabs/tailwindcss-forms/pull/163))
|
|
35
|
+
|
|
36
|
+
## [0.5.7] - 2023-11-10
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- Use normal `checkbox` and `radio` appearance in `forced-colors` mode ([#152](https://github.com/tailwindlabs/tailwindcss-forms/pull/152))
|
|
41
|
+
|
|
42
|
+
## [0.5.6] - 2023-08-28
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Fix date time bottom spacing on MacOS Safari ([#146](https://github.com/tailwindlabs/tailwindcss-forms/pull/146))
|
|
47
|
+
|
|
48
|
+
## [0.5.5] - 2023-08-22
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- Fix text alignment on date and time inputs on iOS ([#144](https://github.com/tailwindlabs/tailwindcss-forms/pull/144))
|
|
53
|
+
|
|
54
|
+
## [0.5.4] - 2023-07-13
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- Remove chevron for selects with a non-default size ([#137](https://github.com/tailwindlabs/tailwindcss-forms/pull/137))
|
|
59
|
+
- Allow for <input> without `type` ([#141](https://github.com/tailwindlabs/tailwindcss-forms/pull/141))
|
|
60
|
+
|
|
61
|
+
## [0.5.3] - 2022-09-02
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- Update TypeScript types ([#126](https://github.com/tailwindlabs/tailwindcss-forms/pull/126))
|
|
66
|
+
|
|
67
|
+
## [0.5.2] - 2022-05-18
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- Add TypeScript type declarations ([#118](https://github.com/tailwindlabs/tailwindcss-forms/pull/118))
|
|
72
|
+
|
|
73
|
+
## [0.5.1] - 2022-05-03
|
|
74
|
+
|
|
75
|
+
### Fixed
|
|
76
|
+
|
|
77
|
+
- Remove duplicate `outline` property ([#116](https://github.com/tailwindlabs/tailwindcss-forms/pull/116))
|
|
78
|
+
- Fix autoprefixer warning about `color-adjust` ([#115](https://github.com/tailwindlabs/tailwindcss-forms/pull/115))
|
|
79
|
+
|
|
80
|
+
## [0.5.0] - 2022-03-02
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- Generate both global styles and classes by default ([#71](https://github.com/tailwindlabs/tailwindcss-forms/pull/71))
|
|
85
|
+
|
|
86
|
+
## [0.4.1] - 2022-03-02
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- Remove `dist` folder and related dependencies ([#96](https://github.com/tailwindlabs/tailwindcss-forms/pull/96))
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
|
|
94
|
+
- Use `addComponents` for class strategy ([#91](https://github.com/tailwindlabs/tailwindcss-forms/pull/91))
|
|
95
|
+
- Fix extra height on Safari date/time inputs ([#109](https://github.com/tailwindlabs/tailwindcss-forms/pull/109))
|
|
96
|
+
|
|
97
|
+
## [0.4.0] - 2021-12-09
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- Update color palette references for v3 ([#83](https://github.com/tailwindlabs/tailwindcss-forms/pull/83))
|
|
102
|
+
- Don't read outline.none value from config ([#89](https://github.com/tailwindlabs/tailwindcss-forms/pull/89))
|
|
103
|
+
|
|
104
|
+
## [0.3.4] - 2021-09-28
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- Fix compatibility with `optimizeUniversalDefaults` experimental feature in Tailwind CSS v2.2 ([#81](https://github.com/tailwindlabs/tailwindcss-forms/pull/81))
|
|
109
|
+
|
|
110
|
+
## [0.3.3] - 2021-06-03
|
|
111
|
+
|
|
112
|
+
### Fixed
|
|
113
|
+
|
|
114
|
+
- Fix typo in selector when using `class` strategy that breaks background colors on checkboxes and radio buttons ([#72](https://github.com/tailwindlabs/tailwindcss-forms/pull/72))
|
|
115
|
+
|
|
116
|
+
## [0.3.2] - 2021-03-26
|
|
117
|
+
|
|
118
|
+
### Fixed
|
|
119
|
+
|
|
120
|
+
- Filter `null` rules for JIT compatibility ([b4c4e03](https://github.com/tailwindlabs/tailwindcss-forms/commit/b4c4e039337c3a5599f5b6d9eabbcc8ab9e8c8d9))
|
|
121
|
+
|
|
122
|
+
## [0.3.1] - 2021-03-26
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
|
|
126
|
+
- Use `base` as default strategy, not `class` ([#61](https://github.com/tailwindlabs/tailwindcss-forms/pull/61))
|
|
127
|
+
|
|
128
|
+
## [0.3.0] - 2021-03-25
|
|
129
|
+
|
|
130
|
+
### Added
|
|
131
|
+
|
|
132
|
+
- Add `class` strategy for you babies and your custom select and date picker libraries ;) ([#39](https://github.com/tailwindlabs/tailwindcss-forms/pull/39))
|
|
133
|
+
|
|
134
|
+
## [0.2.1] - 2020-11-17
|
|
135
|
+
|
|
136
|
+
### Fixed
|
|
137
|
+
|
|
138
|
+
- Fix issue where default checkbox/radio border color took precedence over user border color on focus ([d0b9fd9](https://github.com/tailwindlabs/tailwindcss-forms/commit/d0b9fd9))
|
|
139
|
+
|
|
140
|
+
## [0.2.0] - 2020-11-16
|
|
141
|
+
|
|
142
|
+
### Changed
|
|
143
|
+
|
|
144
|
+
- Update form styles to be less opinionated and encourage custom styling ([3288709](https://github.com/tailwindlabs/tailwindcss-forms/commit/3288709b59f4101511ec19f30cb2dafe7738251e))
|
|
145
|
+
- Update custom property names to match namespaced variables in Tailwind CSS v2.0 ([adb9807](https://github.com/tailwindlabs/tailwindcss-forms/commit/adb98078fc830d0416cb5ea2c895e997d5f0a5ec), [bbd8510](https://github.com/tailwindlabs/tailwindcss-forms/commit/bbd85102ef4a402b3c39d997c025208a33694cc4))
|
|
146
|
+
|
|
147
|
+
## [0.1.4] - 2020-11-12
|
|
148
|
+
|
|
149
|
+
### Fixed
|
|
150
|
+
|
|
151
|
+
- Fix SVG background images not rendering properly in all browsers ([#5](https://github.com/tailwindlabs/tailwindcss-forms/pull/5))
|
|
152
|
+
|
|
153
|
+
## [0.1.3] - 2020-11-12
|
|
154
|
+
|
|
155
|
+
### Changed
|
|
156
|
+
|
|
157
|
+
- Update focus styles to account for changes to `ring` API in latest Tailwind CSS 2.0 alpha ([5c16689](https://github.com/tailwindlabs/tailwindcss-forms/commit/5c166896b06475832bd8364f9f3ef5c4baec585f))
|
|
158
|
+
|
|
159
|
+
## [0.1.2] - 2020-11-11
|
|
160
|
+
|
|
161
|
+
### Fixed
|
|
162
|
+
|
|
163
|
+
- Work around iOS Safari bug that causes date inputs to render with no height when empty ([b98365b](https://github.com/tailwindlabs/tailwindcss-forms/commit/b98365b903b586bfbe7a6ae745ba64b5d87e23e3))
|
|
164
|
+
|
|
165
|
+
## [0.1.1] - 2020-11-11
|
|
166
|
+
|
|
167
|
+
### Changed
|
|
168
|
+
|
|
169
|
+
- Move `tailwindcss` to dependencies, hoping to get it working with Tailwind Play ([d625ea1](https://github.com/tailwindlabs/tailwindcss-forms/commit/d625ea11bd111a4d8cde937e36f3d229ecdf7c6a))
|
|
170
|
+
|
|
171
|
+
## [0.1.0] - 2020-11-11
|
|
172
|
+
|
|
173
|
+
Initial release!
|
|
174
|
+
|
|
175
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.11...HEAD
|
|
176
|
+
[0.5.11]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.10...v0.5.11
|
|
177
|
+
[0.5.10]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.9...v0.5.10
|
|
178
|
+
[0.5.9]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.8...v0.5.9
|
|
179
|
+
[0.5.8]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.7...v0.5.8
|
|
180
|
+
[0.5.7]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.6...v0.5.7
|
|
181
|
+
[0.5.6]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.5...v0.5.6
|
|
182
|
+
[0.5.5]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.4...v0.5.5
|
|
183
|
+
[0.5.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.3...v0.5.4
|
|
184
|
+
[0.5.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.2...v0.5.3
|
|
185
|
+
[0.5.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.1...v0.5.2
|
|
186
|
+
[0.5.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.0...v0.5.1
|
|
187
|
+
[0.5.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.4.1...v0.5.0
|
|
188
|
+
[0.4.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.4.0...v0.4.1
|
|
189
|
+
[0.4.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.3...v0.4.0
|
|
190
|
+
[0.3.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.3...v0.3.4
|
|
191
|
+
[0.3.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.2...v0.3.3
|
|
192
|
+
[0.3.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.1...v0.3.2
|
|
193
|
+
[0.3.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.0...v0.3.1
|
|
194
|
+
[0.3.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.2.1...v0.3.0
|
|
195
|
+
[0.2.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.2.0...v0.2.1
|
|
196
|
+
[0.2.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.4...v0.2.0
|
|
197
|
+
[0.1.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.3...v0.1.4
|
|
198
|
+
[0.1.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.2...v0.1.3
|
|
199
|
+
[0.1.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.1...v0.1.2
|
|
200
|
+
[0.1.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.0...v0.1.1
|
|
201
|
+
[0.1.0]: https://github.com/tailwindlabs/tailwindcss-forms/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Tailwind Labs, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# tailwindcss-forms-style
|
|
2
|
+
|
|
3
|
+
A plugin that provides a basic reset for form styles that makes form elements easy to override with utilities.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the plugin from npm:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install -D tailwindcss-forms-style
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then, when using Tailwind CSS v4, add the plugin to your main stylesheet:
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
/* app.css */
|
|
17
|
+
@import "tailwindcss";
|
|
18
|
+
@plugin "tailwindcss-forms-style";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If you are still using **Tailwind CSS v3**, add the plugin to your `tailwind.config.js` file:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
// tailwind.config.js
|
|
25
|
+
module.exports = {
|
|
26
|
+
theme: {
|
|
27
|
+
// ...
|
|
28
|
+
},
|
|
29
|
+
plugins: [
|
|
30
|
+
require('tailwindcss-forms-style'),
|
|
31
|
+
// ...
|
|
32
|
+
],
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Basic usage
|
|
37
|
+
|
|
38
|
+
[**View the live demo**](https://tailwindcss-forms.vercel.app/)
|
|
39
|
+
|
|
40
|
+
All of the basic form elements you use will now have some simple default styles that are easy to override with utilities.
|
|
41
|
+
|
|
42
|
+
Currently we add basic utility-friendly form styles for the following form element types:
|
|
43
|
+
|
|
44
|
+
- `input[type='text']`
|
|
45
|
+
- `input[type='password']`
|
|
46
|
+
- `input[type='email']`
|
|
47
|
+
- `input[type='number']`
|
|
48
|
+
- `input[type='url']`
|
|
49
|
+
- `input[type='date']`
|
|
50
|
+
- `input[type='datetime-local']`
|
|
51
|
+
- `input[type='month']`
|
|
52
|
+
- `input[type='week']`
|
|
53
|
+
- `input[type='time']`
|
|
54
|
+
- `input[type='search']`
|
|
55
|
+
- `input[type='tel']`
|
|
56
|
+
- `input[type='checkbox']`
|
|
57
|
+
- `input[type='radio']`
|
|
58
|
+
- `select`
|
|
59
|
+
- `select[multiple]`
|
|
60
|
+
- `textarea`
|
|
61
|
+
|
|
62
|
+
Every element has been normalized/reset to a simple visually consistent style that is easy to customize with utilities, even elements like `<select>` or `<input type="checkbox">` that normally need to be reset with `appearance: none` and customized using custom CSS:
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<!-- You can actually customize padding on a select element now: -->
|
|
66
|
+
<select class="rounded-full px-4 py-3">
|
|
67
|
+
<!-- ... -->
|
|
68
|
+
</select>
|
|
69
|
+
|
|
70
|
+
<!-- Or change a checkbox color using text color utilities: -->
|
|
71
|
+
<input type="checkbox" class="rounded text-pink-500" />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
More customization examples and best practices coming soon.
|
|
75
|
+
|
|
76
|
+
### Using classes to style
|
|
77
|
+
|
|
78
|
+
In addition to the global styles, we also generate a set of corresponding classes which can be used to explicitly apply the form styles to an element. This can be useful in situations where you need to make a non-form element, such as a `<div>`, look like a form element.
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<input type="email" class="form-input rounded-full px-4 py-3" />
|
|
82
|
+
|
|
83
|
+
<select class="form-select rounded-full px-4 py-3">
|
|
84
|
+
<!-- ... -->
|
|
85
|
+
</select>
|
|
86
|
+
|
|
87
|
+
<input type="checkbox" class="form-checkbox rounded text-pink-500" />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Here is a complete table of the provided `form-*` classes for reference:
|
|
91
|
+
|
|
92
|
+
| Base | Class |
|
|
93
|
+
| ------------------------- | ------------------ |
|
|
94
|
+
| `[type='text']` | `form-input` |
|
|
95
|
+
| `[type='email']` | `form-input` |
|
|
96
|
+
| `[type='url']` | `form-input` |
|
|
97
|
+
| `[type='password']` | `form-input` |
|
|
98
|
+
| `[type='number']` | `form-input` |
|
|
99
|
+
| `[type='date']` | `form-input` |
|
|
100
|
+
| `[type='datetime-local']` | `form-input` |
|
|
101
|
+
| `[type='month']` | `form-input` |
|
|
102
|
+
| `[type='search']` | `form-input` |
|
|
103
|
+
| `[type='tel']` | `form-input` |
|
|
104
|
+
| `[type='time']` | `form-input` |
|
|
105
|
+
| `[type='week']` | `form-input` |
|
|
106
|
+
| `textarea` | `form-textarea` |
|
|
107
|
+
| `select` | `form-select` |
|
|
108
|
+
| `select[multiple]` | `form-multiselect` |
|
|
109
|
+
| `[type='checkbox']` | `form-checkbox` |
|
|
110
|
+
| `[type='radio']` | `form-radio` |
|
|
111
|
+
|
|
112
|
+
### Using only global styles or only classes
|
|
113
|
+
|
|
114
|
+
Although we recommend thinking of this plugin as a "form reset" rather than a collection of form component styles, in some cases our default approach may be too heavy-handed, especially when integrating this plugin into existing projects.
|
|
115
|
+
|
|
116
|
+
If generating both the global (base) styles and classes doesn't work well with your project, you can use the `strategy` option to limit the plugin to just one of these approaches.
|
|
117
|
+
|
|
118
|
+
When using Tailwind CSS v4, configure the plugin in your main stylesheet:
|
|
119
|
+
|
|
120
|
+
```css
|
|
121
|
+
/* app.css */
|
|
122
|
+
@plugin "tailwindcss-forms-style" {
|
|
123
|
+
strategy: "base"; /* only generate global styles; or */
|
|
124
|
+
strategy: "class"; /* only generate classes */
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
If you are still using **Tailwind CSS v3**, configure the plugin in your `tailwind.config.js` file:
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
// tailwind.config.js
|
|
132
|
+
plugins: [
|
|
133
|
+
require("tailwindcss-forms-style")({
|
|
134
|
+
strategy: 'base', // only generate global styles
|
|
135
|
+
strategy: 'class', // only generate classes
|
|
136
|
+
}),
|
|
137
|
+
],
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
When using the `base` strategy, form elements are styled globally, and no `form-{name}` classes are generated.
|
|
141
|
+
|
|
142
|
+
When using the `class` strategy, form elements are not styled globally, and instead must be styled using the generated `form-{name}` classes.
|