1345 Commits

Author SHA1 Message Date
Adam Wathan
425c73feec Ensure variants are grouped properly for plugins with order-dependent utilities (#4273) 2021-05-07 13:56:16 -04:00
Adam Wathan
dec1fc3df3 Support forcing coercion type with arbitrary value syntax (#4263)
* Support forcing coercion type with arbitrary value syntax

* Refactor + more tests
2021-05-07 13:56:16 -04:00
Brad Cornes
73fe57aea9 [JIT] Add support for "raw" purge content (#4272)
* add support for "raw" purge content

* add support for raw content extensions
2021-05-07 13:56:16 -04:00
Adam Wathan
114baeeef1 Support applying important utilities in JIT (#4260) 2021-05-07 13:56:16 -04:00
Adam Wathan
82a13cde84 Ignore unknown types when hashing config 2021-05-07 13:56:16 -04:00
Robin Malfait
c7bcfe52cd simplify animation tests and improve stability (#4250)
This will make sure that we tackle a few additional edge cases:

- When the `name` is the same as a reserved keyword, then it will be
  used as a `name` as well. E.g.: 1s ease ease infinite; Will result in
  a name of `ease` as well.
- We take care of trimming and multiple spaces.
- We don't generate 8k tests anymore, which means that these specific
  tests only take a second instead of 10 seconds.
2021-05-07 13:56:15 -04:00
Robin Malfait
0c5c5409d7 Improve matchUtilities API and make it work with the AOT engine (#4232)
* implement matchUtilities2

* ensure animation names without keyframes are not prefixed

* remove matchBase

* call addUtilities for each group individually

* WIP: Write plugins using matchUtilities2

* MORE

* Fix arbitrary value support for fontSize

* Fixes, update fixtures

* Rebuild fixtures

* Don't generate `divide` class with no modifier

* Fixes, rebuild fixtures

* Rename matchUtilities2 to matchUtilities

* Delete bad tests

* Remove temp files GROSS

* Clean stuff up

* Support no return in matchUtilities

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-05-07 13:56:15 -04:00
Adam Wathan
f9707015f8 Note new matchUtilities API design 2021-05-07 13:56:15 -04:00
Adam Wathan
cc4d1d2658 Refactor fontVariantNumeric to remove mode condition 2021-05-07 13:56:15 -04:00
Adam Wathan
297cb675df Remove support for returning an array of functions in matchUtilities
Can add again if we need it?
2021-05-07 13:56:15 -04:00
Adam Wathan
cd2db712c5 Very basic AOT matchUtilities support 2021-05-07 13:56:15 -04:00
Robin Malfait
d497777202 [WIP] Unify JIT and AOT code paths (#4188)
* WIP

* WIP

* Finish combining JIT and AOT plugins

Still lots of clean up that can be done in some of the more complex ones, but at least it's one file per plugin now.

* Remove unused import

* Fix AOT generation bugs

* Move corePlugins/index.js to corePlugins.js

* Convert JIT files to ESM

* Move tests

* Reorder core plugins to match JIT order

* Update AOT apply tests

* Unify utils

* Combine plugin lists to one single source of truth

* Finish resolving merge conflicts, fix tests

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-05-07 13:56:15 -04:00
Axel Hernández Ferrera
ed1727ab86 Improve @apply performance (#3718)
* Split the buildUtilityMap function to memoize the static part

* fix tests
2021-05-07 13:56:14 -04:00
Adam Wathan
57102aaa5a Refactor preserving rgb/hsl when adding alpha channel 2021-05-07 13:56:14 -04:00
Federico Ciardi
4daf57e543 feat: transform hsl to hsla (#3850)
* feat: transform `hsl` to `hsla`

* feat: update plugins using `toRgba`

* Test `gradientColorStops`

* Add test for `ringWidth`

* Add percentage symbol after Saturation and Lightness
2021-05-07 13:56:14 -04:00
David Luhr
6c7f3c8f8c Add background-origin utilities (#4117)
* Add background-origin utilities

* Update fixtures

* Update basic usage test

* Change sort order for background origin

* Move background origin after other background properties
2021-05-07 13:56:14 -04:00
Robin Malfait
9546d337e6 Fix invalid arg type (#3978)
* default to `tailwind.css` file when no input is given

* skip undefined files

* update forgotten test fixtures
2021-05-07 13:56:13 -04:00
Adam Wathan
59b7396365 Escape commas in native escapeClassName and nameClass functions 2021-05-07 13:56:13 -04:00
Adam Wathan
a05b36996b Add CSS filter support (#3923)
* Implement `filter` helper classes with all methods

* Rename filter plugins/utilities, drop filter opacity, add drop shadow

* Remove non-final default filter values

* Working on default filter values, add basic JIT support

* Working on blur values

* New blur values (these are ~okay)

* Match drop-shadow values to box-shadows by eye as best as possible

* Update tests

* Fix kitchen sink test

* Add filter variants configuration

* Move drop-shadow to end of filters list

Co-Authored-By: Peter Neupauer <peter@neupauer.sk>

* Add invert variants configuration

* Add backdrop-filter utilities

* Update tests

* Transition filters by default

* Alphabetize new config keys

* Optimize filter plugins for JIT + add arbitrary value support

Except for drop-shadow, will add that once we can think it through a bit.

Co-authored-by: Nick Schmidt <nick@kreativgebiet.com>
Co-authored-by: Peter Neupauer <peter@neupauer.sk>
2021-05-07 13:56:13 -04:00
Peter Neupauer
04a1771700 Add list-item display utility (#3929)
Signed-off-by: Peter Neupauer <peter@neupauer.sk>
2021-05-07 13:56:13 -04:00
Adam Wathan
f34214eccc Add mix-blend-mode and background-blend-mode utilities (#3920)
* Add mix-blend-mode utilities

* Rename mix-blend-mode utilities to `mix-blend-*`

Co-Authored-By: Peter Neupauer <peter@neupauer.sk>

* Add `background-blend-mode` utilities

Co-Authored-By: Peter Neupauer <peter@neupauer.sk>

Co-authored-by: Peter Neupauer <peter@neupauer.sk>
2021-05-07 13:56:13 -04:00
Adam Wathan
7a5c73878f Derive JIT display utilities from AOT display plugin 2021-05-07 13:56:13 -04:00
Erik Verbeek
49461d9e7a Added support for display : inline-table (#3563)
* Added support for display : inline-table

* Moved the inline-table class to the suggested spot and updated the tests

Co-authored-by: Erik Verbeek <erik@evidencio.com>
2021-05-07 13:56:12 -04:00
Adam Wathan
ab41845a78 Remove justify-auto and place-items-auto
These CSS values don't even exist.
2021-05-07 13:56:12 -04:00
Adam Wathan
9c454e1d4b Add isolation utilities (#3914) 2021-05-07 13:56:12 -04:00
Adam Wathan
77ca74bb88 Add box-decoration-break utilities (#3911) 2021-05-07 13:56:12 -04:00
Adam Wathan
d81edb739d Add PostCSS 7 support (maybe) 2021-05-07 13:56:11 -04:00
Adam Wathan
71737de6d1 Only warn about JIT engine once 2021-05-07 13:56:11 -04:00
Adam Wathan
bf9e3c6837 Add mode option to use JIT code path 2021-05-07 13:56:11 -04:00
Peter Timoshevsky
2b0e71a4ec Fix typo in preflight.css 2021-05-07 13:56:11 -04:00
Adam Wathan
a8a81e64da Pass full opacityValue always 2021-05-07 13:56:11 -04:00
Dylan Vann
c629ebb811 Fix function colors bug (#2919) 2021-05-07 13:56:10 -04:00
Nate Moore
f1ee046685 Adds support for tailwind.config.cjs files (#3181)
* feat: automatically init and resolve tailwind.config.cjs files

* test: add tests for default tailwind.config.cjs resolution

* fix `cjsConfigFile` constant

* Fix JSDoc type of isModule
2021-05-07 13:56:10 -04:00
Robin Malfait
7ad9a548ef add version and license (#3255)
* add current version & license

* generate fixtures

* update changelog

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-05-07 13:56:10 -04:00
Adam Wathan
ca21b4e6b4 Set explicit opacity value on placeholder pseudo-element (#3308)
Fixes #3300.
2021-05-07 13:56:09 -04:00
Martin Stühmer
251c8d2490 Version number corrected in substituteTailwindAtRules (#3237) 2021-05-07 13:56:09 -04:00
Illia Sakovich
7c62ecdcdd from: undefined -> from: __filename (#3356) 2021-05-07 13:56:09 -04:00
Andrew
d552e20096 create new "empty" variant
this will generate classes like the following:

```css
.empty\:hidden:empty {
  display: none
}
```
2021-01-06 12:19:21 -06:00
Robin Malfait
eac11cf57d
Performance improvements + memory leak fix (#3032)
* fix memory leak

* add optional condition to hasAtRule

* use known tree to handle `@apply` when required `@tailwind` at rules exists

Otherwise we will generate the lookup tree.

* only generate the missing `@tailwind` atrules when using `@apply`

* update perf config to reflect 2.0 changes

* update changelog

* ensure lookup tree is correctly cached based on used tailwind atrules
2020-12-11 15:03:49 +01:00
Robin Malfait
d1ef88a61b
ring defaults (#2951)
* add ring defaults

Fixes #2911

* add tests for the ringWidth utility

+ defaults

* update changelog
2020-12-02 15:45:04 -05:00
Robin Malfait
152202916c
Allow for recursively applying user defined classes (#2832) 2020-11-26 15:05:06 +01:00
Stefan Fisk
1e0fc09e0a
Fix !important on multiple selectors #2823 (#2824)
* Add failing test for #2823

* cleanup string literals

* use prettier for toMatchCSS diffs

* make sure that importants are applied correctly

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2020-11-26 14:53:58 +01:00
Adam Wathan
e40079a457 Fix cascading shadow/ring bug, ensure default ring color 2020-11-16 19:47:45 -05:00
Adam Wathan
2245f26e60 Rename plugin in compat mode 2020-11-16 14:13:49 -05:00
Robin Malfait
c238ed15b5
Improve compat mode (#2775)
* simplify compat mode

* make sure postcss is included

* make sure we cannot go into compatibility mode twice
2020-11-16 14:10:08 -05:00
Robin Malfait
1d8679d37e
Postcss7 compatibility (#2773)
* add postcss7 compatibility layers

* add compatibility mode scripts
2020-11-16 13:09:59 -05:00
Robin Malfait
b86bdbcd7e
Cleanup custom properties (#2771)
* prefix custom properties with tw-

* prefix custom properties with tw- in tests

* prefix gradient values in the defaultConfig

* inline gradient-via-color

* simplify --tw-tailwind-empty to --tw-empty

* replace the long --tw-font-variant-numeric-... to the way shorter --tw-fvn-...

* Rename --tw-box-shadow to --tw-shadow

To match class name.

* Rename font-variant-numeric variables

* Remove 'transform' from transform variables

* Shorten gradient variables

* Fix style

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2020-11-16 11:45:55 -05:00
Adam Wathan
729b400a68 Upgrade to PostCSS 8 2020-11-15 16:13:48 -05:00
Adam Wathan
b95cf5f595
Remove clearfix utility (#2766) 2020-11-13 22:25:23 -05:00
Adam Wathan
278c2031fb Fix bug where color palette could not be empty 2020-11-13 19:51:05 -05:00