Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c6d19fb
Add ‘useFormClasses’ plugin option
chasegiunta Jan 29, 2021
e84f83f
Fix leftover
chasegiunta Jan 29, 2021
2635e54
Merge branch 'master' of https://github.com/tailwindlabs/tailwindcss-…
chasegiunta Mar 23, 2021
4231d49
Merge pull request #58 from tailwindlabs/add-license-1
adamwathan Mar 24, 2021
1d8f79d
Update Tailwind, fix checkbox example
adamwathan Nov 17, 2020
8304072
Add simple dev server
adamwathan Nov 17, 2020
63c9664
Remove aggressive border override
adamwathan Nov 17, 2020
0aa2921
Update changelog
adamwathan Nov 17, 2020
571d9d7
0.2.1
adamwathan Nov 17, 2020
810b807
Merge branch 'master' of https://github.com/tailwindlabs/tailwindcss-…
chasegiunta Mar 24, 2021
b221e81
Rename option to `strategy` with `base` & `class` options
chasegiunta Mar 25, 2021
5ec6608
Use .form-multiselect & .form-file classes where applicable
chasegiunta Mar 25, 2021
fbfe0ee
Refactor for more a maintainable approach with selector strategy
chasegiunta Mar 25, 2021
5f18069
Update README.md
chasegiunta Mar 25, 2021
456cfd1
Update README.md
chasegiunta Mar 26, 2021
ab4790d
Add classes to kitchen sink for testing
adamwathan Mar 26, 2021
3bfbd1a
Add default options
adamwathan Mar 26, 2021
224e966
Use single addBase call
adamwathan Mar 26, 2021
2626d3e
Don't add "undo" styles when using class strategy
adamwathan Mar 26, 2021
2779a67
Update README
adamwathan Mar 26, 2021
39f6a3d
Merge branch 'chasegiunta-master'
adamwathan Mar 26, 2021
4b170dd
Update changelog
adamwathan Mar 26, 2021
241613f
0.3.0
adamwathan Mar 26, 2021
6abf160
Fix default strategy
Xenonym Mar 26, 2021
630a9d6
Merge pull request #61 from Xenonym/patch-1
adamwathan Mar 26, 2021
c9e3218
Update changelog
adamwathan Mar 26, 2021
48bd970
0.3.1
adamwathan Mar 26, 2021
b4c4e03
Filter null rules
adamwathan Mar 26, 2021
cf37807
Update 1.bug_report.yml
adamwathan Apr 8, 2021
4c083b6
Update 1.bug_report.yml
RobinMalfait Apr 20, 2021
c6a2ff4
removing the `issue_body` key
simonswiss Apr 20, 2021
7970ffd
Update 1.bug_report.yml
adamwathan May 24, 2021
8ea3430
Update 1.bug_report.yml
adamwathan May 24, 2021
e8a287e
Fix :checked typo
chasegiunta Jun 1, 2021
1f0a7c8
Merge pull request #72 from chasegiunta/master
adamwathan Jun 3, 2021
e88eda2
Update changelog
adamwathan Mar 26, 2021
885034f
0.3.2
adamwathan Mar 26, 2021
d1613f9
Update CHANGELOG
adamwathan Jun 3, 2021
6f951b2
0.3.3
adamwathan Jun 3, 2021
e926598
Update index.html
adamwathan Jun 20, 2021
39946dd
Update kitchen-sink.html
adamwathan Jun 20, 2021
241ac86
add default box shadow reset
RobinMalfait Sep 16, 2021
a7680e8
Remove duplicate variable declaration
adamwathan Sep 21, 2021
add1126
Merge pull request #81 from tailwindlabs/add-box-shadow-reset
adamwathan Sep 21, 2021
c3ea323
Update changelog
adamwathan Sep 21, 2021
457b558
0.3.4
reinink Sep 28, 2021
3d8b485
Update changelog
reinink Sep 28, 2021
93857e1
Pull colors from tailwindcss/colors, not defaultTheme
adamwathan Sep 30, 2021
61902f6
Merge pull request #83 from tailwindlabs/update-colors
adamwathan Sep 30, 2021
12c53c3
Update demo to use v3
adamwathan Oct 1, 2021
a7705a9
0.4.0-alpha.1
adamwathan Oct 1, 2021
1c926a2
add release-insiders build
RobinMalfait Oct 4, 2021
491a834
Merge pull request #84 from tailwindlabs/release-insiders
RobinMalfait Oct 5, 2021
ce5386b
Remove dependency on old `outline.none` config value
reinink Oct 27, 2021
2bd8f7e
Merge pull request #89 from tailwindlabs/outline-none-fix
reinink Oct 27, 2021
df8ac72
update changelog
RobinMalfait Dec 9, 2021
e8e01c3
0.4.0
RobinMalfait Dec 9, 2021
533f0ce
Remove `dist` folder and related dependencies (#96)
RobinMalfait Dec 15, 2021
becd3b2
Update supported tailwind version in README (#99)
cornips Jan 20, 2022
e17d25f
Add autoprefixer and postcss as dev deps
thecrypticace Jan 20, 2022
bb5315c
Update LICENSE
adamwathan Feb 5, 2022
807cd40
Use `addComponents` for class strategy (#91)
f15u Feb 23, 2022
d7b1a9a
update changelog
RobinMalfait Feb 23, 2022
0b1e872
Update README.md
bradlc Feb 25, 2022
1bd06b1
Update kitchen sink markup
adamwathan Feb 28, 2022
99fbd47
Fix extra height on Safari date/time inputs (#109)
thecrypticace Mar 1, 2022
2eb6f96
Update changelog
thecrypticace Mar 2, 2022
9a0c0e4
0.4.1
thecrypticace Mar 2, 2022
1871f90
Generate both global styles and classes by default (#71)
sanscheese Mar 2, 2022
c74eecc
Update changelog
thecrypticace Mar 2, 2022
3103e33
0.5.0
thecrypticace Mar 2, 2022
37912e9
Fix for multiple Select (#113)
labnol Apr 17, 2022
01edbb6
Remove duplicate `outline` property (#116)
thecrypticace May 2, 2022
203d454
Fix autoprefixer warning about `color-adjust` (#115)
thecrypticace May 2, 2022
639211c
update changelog
thecrypticace May 3, 2022
0894508
0.5.1
thecrypticace May 3, 2022
7ef7a14
Dummy change to make insider builds happy
thecrypticace May 3, 2022
c763df9
Add type declaration (#118)
RobinMalfait May 18, 2022
471c040
update changelog
RobinMalfait May 18, 2022
88c2ba7
update changelog
RobinMalfait May 18, 2022
19e4dda
0.5.2
RobinMalfait May 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Bug Report
description: Create a bug report for @tailwindcss/forms.
title: ''
labels: []
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t thay may code cung hay lam chu bo

issue_body: true
body:
- type: input
attributes:
Expand Down Expand Up @@ -31,9 +29,10 @@ body:
- type: input
attributes:
label: Reproduction repository
description: A public GitHub repo that demonstrates the bug. If it's really unnecessary, link me to a YouTube video you think is awesome instead.
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.
validations:
required: true
- type: markdown
- type: textarea
attributes:
value: "## Describe your issue\nDescribe the problem you're seeing, any important steps to reproduce and what behavior you expect instead"
label: Describe your issue
description: Describe the problem you're seeing, any important steps to reproduce and what behavior you expect instead
50 changes: 50 additions & 0 deletions .github/workflows/release-insiders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release Insiders

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Use cached node_modules
id: cache
uses: actions/cache@v2
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
restore-keys: |
nodeModules-

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
env:
CI: true

- name: Resolve version
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: "Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}"
run: npm version 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version

- name: Publish
run: npm publish --tag insiders
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
86 changes: 85 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,79 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Nothing yet!

## [0.5.2] - 2022-05-18

### Added

- Add TypeScript type declarations ([#118](https://github.com/tailwindlabs/tailwindcss-forms/pull/118))

## [0.5.1] - 2022-05-03

### Fixed

- Remove duplicate `outline` property ([#116](https://github.com/tailwindlabs/tailwindcss-forms/pull/116))
- Fix autoprefixer warning about `color-adjust` ([#115](https://github.com/tailwindlabs/tailwindcss-forms/pull/115))

## [0.5.0] - 2022-03-02

### Changed

- Generate both global styles and classes by default ([#71](https://github.com/tailwindlabs/tailwindcss-forms/pull/71))

## [0.4.1] - 2022-03-02

### Added

- Remove `dist` folder and related dependencies ([#96](https://github.com/tailwindlabs/tailwindcss-forms/pull/96))

### Fixed

- Use `addComponents` for class strategy ([#91](https://github.com/tailwindlabs/tailwindcss-forms/pull/91))
- Fix extra height on Safari date/time inputs ([#109](https://github.com/tailwindlabs/tailwindcss-forms/pull/109))

## [0.4.0] - 2021-12-09

### Changed

- Update color palette references for v3 ([#83](https://github.com/tailwindlabs/tailwindcss-forms/pull/83))
- Don't read outline.none value from config ([#89](https://github.com/tailwindlabs/tailwindcss-forms/pull/89))

## [0.3.4] - 2021-09-28

### Fixed

- Fix compatibility with `optimizeUniversalDefaults` experimental feature in Tailwind CSS v2.2 ([#81](https://github.com/tailwindlabs/tailwindcss-forms/pull/81))

## [0.3.3] - 2021-06-03

### Fixed

- 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))

## [0.3.2] - 2021-03-26

### Fixed

- Filter `null` rules for JIT compatibility ([b4c4e03](https://github.com/tailwindlabs/tailwindcss-forms/commit/b4c4e039337c3a5599f5b6d9eabbcc8ab9e8c8d9))

## [0.3.1] - 2021-03-26

### Fixed

- Use `base` as default strategy, not `class` ([#61](https://github.com/tailwindlabs/tailwindcss-forms/pull/61))

## [0.3.0] - 2021-03-25

### Added

- Add `class` strategy for you babies and your custom select and date picker libraries ;) ([#39](https://github.com/tailwindlabs/tailwindcss-forms/pull/39))

## [0.2.1] - 2020-11-17

### Fixed

- 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))

## [0.2.0] - 2020-11-16

### Changed
Expand Down Expand Up @@ -44,7 +117,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Initial release!

[unreleased]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.2.0...HEAD
[unreleased]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.2...HEAD
[0.5.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.4.1...v0.5.0
[0.4.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.3...v0.4.0
[0.3.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.4...v0.2.0
[0.1.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.2...v0.1.3
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Tailwind Labs
Copyright (c) Tailwind Labs, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
66 changes: 58 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ A plugin that provides a basic reset for form styles that makes form elements ea

## Installation

> Note that @tailwindcss/forms is designed for Tailwind CSS v2.0.

Install the plugin from npm:

```sh
# Using npm
npm install @tailwindcss/forms

# Using Yarn
yarn add @tailwindcss/forms
npm install -D @tailwindcss/forms
```

Then add the plugin to your `tailwind.config.js` file:
Expand All @@ -31,7 +25,7 @@ module.exports = {
}
```

## Usage
## Basic usage

[**View the live demo**](https://tailwindcss-forms.vercel.app/)

Expand Down Expand Up @@ -72,3 +66,59 @@ Every element has been normalized/reset to a simple visually consistent style th
```

More customization examples and best practices coming soon.

### Using classes to style

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.

```html
<input type="email" class="form-input px-4 py-3 rounded-full">

<select class="form-select px-4 py-3 rounded-full">
<!-- ... -->
</select>

<input type="checkbox" class="form-checkbox rounded text-pink-500" />
```

Here is a complete table of the provided `form-*` classes for reference:

| Base | Class |
| ------------------------- | ------------------ |
| `[type='text']` | `form-input` |
| `[type='email']` | `form-input` |
| `[type='url']` | `form-input` |
| `[type='password']` | `form-input` |
| `[type='number']` | `form-input` |
| `[type='date']` | `form-input` |
| `[type='datetime-local']` | `form-input` |
| `[type='month']` | `form-input` |
| `[type='search']` | `form-input` |
| `[type='tel']` | `form-input` |
| `[type='time']` | `form-input` |
| `[type='week']` | `form-input` |
| `textarea` | `form-textarea` |
| `select` | `form-select` |
| `select[multiple]` | `form-multiselect` |
| `[type='checkbox']` | `form-checkbox` |
| `[type='radio']` | `form-radio` |

### Using only global styles or only classes

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.

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.

```js
// tailwind.config.js
plugins: [
require("@tailwindcss/forms")({
strategy: 'base', // only generate global styles
strategy: 'class', // only generate classes
}),
],
```

When using the `base` strategy, form elements are styled globally, and no `form-{name}` classes are generated.

When using the `class` strategy, form elements are not styled globally, and instead must be styled using the generated `form-{name}` classes.
3 changes: 0 additions & 3 deletions dist/.gitignore

This file was deleted.

Empty file removed dist/.npmignore
Empty file.
Loading