4079 Commits

Author SHA1 Message Date
Robin Malfait
f425661a90
rebuild fixtures 2021-06-18 16:35:19 +02:00
Robin Malfait
39db485483
update changelog 2021-06-18 16:35:19 +02:00
Robin Malfait
f6e36c2847
Fix stacking context issue (#4700)
* add no-op transform, filter, backdrop-filter utilities

* update tests
2021-06-18 16:31:14 +02:00
Robin Malfait
2fd6575095
2.2.1 v2.2.1 2021-06-18 15:42:31 +02:00
Robin Malfait
ea7b3f6189
rebuild fixtures 2021-06-18 15:42:18 +02:00
Robin Malfait
ade93d2343
update changelog 2021-06-18 15:41:08 +02:00
Adam Wathan
0148ee9535 Update changelog 2021-06-18 09:39:17 -04:00
Robin Malfait
0b6176bacf
Fix media queries for postcss7 (#4695)
This fixes a postcss7 issues where .append() does not clear the children
2021-06-18 15:37:52 +02:00
Robin Malfait
70ca673d96
ensure the CLI in watch mode keeps running when on error (#4693) 2021-06-18 08:46:00 -04:00
Adam Wathan
418d223837 Update fixtures 2021-06-17 14:45:44 -04:00
Adam Wathan
0bc3eeb0f6 2.2.0 v2.2.0 2021-06-17 12:01:32 -04:00
Adam Wathan
729b09adab Update CHANGELOG 2021-06-17 12:01:29 -04:00
Robin Malfait
674d79d0ac
move cssnano to devDependencies 2021-06-17 17:54:32 +02:00
Robin Malfait
f63b4531f5
Add tailwindcss/nesting plugin (#4673)
* add nesting plugin

* rename @tailwindcss/nesting to tailwindcss/nesting

* ignore the built `nesting` plugin

* add a postcss7 compat version

* include `nesting` plugin when publishing

* add `build-plugins` script

This will allow us to keep the plugins in their dedicated folders +
tests + postcss7 compatibility files. However, when we copy over the
plugins to the root. For example `plugins/nesting/` -> `nesting/` we
skip files like `.test.js` and `.postcss7.js`.

* build plugins when running `prepublishOnly`

* improve compat mode

We will use a glob so that we can move all *.postcss7.* files to just
*.* likewise we will also backup to *.* to *.postcss8.* for restoring
purposes.

Concrete example:

- Current state:
  - index.js            // PostCSS 8 implementation
  - index.postcss7.js   // PostCSS 7 implementation

- Run "compat"
  - index.js            // PostCSS 7 implementation
  - index.postcss7.js   // PostCSS 7 implementation
  - index.postcss8.js   // PostCSS 8 implementation (Backup of original)

- Run "compat:restore"
  - index.js            // PostCSS 8 implementation
  - index.postcss7.js   // PostCSS 7 implementation
  - X index.postcss8.js // PostCSS 8 implementation (Removed)

* Update README.md

* ensure we `npm install` before publishing

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-06-17 09:43:52 -04:00
Brad Cornes
243e8814d8
Resolve purge paths relative to the current working directory (#4655)
* resolve purge paths relative to cwd

* simplify test
2021-06-15 16:37:04 -04:00
Robin Malfait
38a71d8d60
Use tmp file as a touch file (#4650)
* use `~/.cache/tailwindcss` as default touch dir

When more tools catch up with the latest postcss dependency tracking,
then we probably don't even need this anymore. However, it is a good
practice to put (global) caches in ~/.cache and (global) configs in
~/.config

Fixes: #4569

* change test to verify @tailwind base slightly

Because of some changes in tailwind itself, the base selector contains a
ton of new --tw-* custom properties. Keeping this up to date might be a
bit of an annoying challenge. So instead we now check for the selector
to be present.

* add `tmp` package

* use a (simple) temporary file, instead of a full cache dir
2021-06-15 10:06:29 -04:00
Adam Wathan
af4a77ae8f Remove unused import 2021-06-14 16:14:07 -04:00
Adam Wathan
81816df3a1 Support arbitrary values for object-position 2021-06-14 16:03:14 -04:00
Robin Malfait
0d47ffd2d3
Fix cloning issues (#4646)
* ensure postcss 7 is dropped from dev dependencies as well

Drop incorrect "help" text

* ensure we are cloning nodes

This is an issue in postcss 7 and fixed in postcss 8. However the compat build still suffers form this issue.
2021-06-14 17:48:28 +02:00
depfu[bot]
03eab314df Update prettier to version 2.3.1 2021-06-12 10:49:22 +00:00
depfu[bot]
7f564d275a Update eslint to version 7.28.0 2021-06-11 23:03:43 +00:00
Adam Wathan
546cff81e7
Allow quotes in arbitrary value blocks (#4625) 2021-06-11 09:55:35 -04:00
Adam Wathan
cb2598ce33
Add support for transform, filter, backdrop-filter, box-shadow and ring to pseudo-elements (#4624)
* Add support for transform, filter, backdrop-filter, box-shadow and ring to pseudo-elements

* Rebuild fixtures
2021-06-11 09:11:56 -04:00
Adam Wathan
d6da12ff0c Update CHANGELOG 2021-06-10 12:22:04 -04:00
Adam Wathan
ff64417ff7
Add blur-none with intent to deprecate blur-0 (#4614)
We always use `none` for other utilities where the values have string names like `sm`, but for `blur` I chose `blur-0` for some idiotic reason. Can't have that.
2021-06-10 12:13:19 -04:00
Adam Wathan
34d0551e93
Remove need for filter and backdrop-filter toggles (#4611) 2021-06-10 11:36:15 -04:00
Robin Malfait
f4799a32e8
add tests for the --postcss option in the new CLI (#4607)
* add tests for the --postcss option in the new CLI

* add `oneOf` ability to the `arg()` functionality

By default, `arg()` doesn't have a way to define multiple types. We want
the possibility of using `--postcss` (Boolean) or `--postcss
./custom-path.js`. But by default this is not possible.

This commit will allow us to do a few things, mainly:
- Keep the same API using the `{ type: oneOf(String, Boolean), description: '...' }`
- Keep the `--help` output similar

What we did behind the scenes is make sure to put the non recognized
flags in the `_` arguments list. This is possible by doing `permissive:
true`. We then manually parse those and resolve the correct value.

* ensure that we can use a custom `--postcss ./with-custom-path.js`
2021-06-10 11:35:17 -04:00
Adam Wathan
b86aa5c2a9
Remove need for transform toggle (#4604) 2021-06-10 09:15:41 -04:00
Robin Malfait
6f1d5f03cb
prefer local plugins (#4598)
* prefer local plugins over bundled plugins

* hoist resolving of plugins

* drop `options` when local `cssnano` is found
2021-06-09 13:13:30 -04:00
Adam Wathan
976acb4987 Update changelog 2021-06-09 10:34:14 -04:00
Robin Malfait
8518fee9ea
implement purge safelist (#4580)
* fix --help output in tests

* add tests to ensure we can use `purge.safelist`

* implement the `purge.safelist` for strings

* proxy `purge.safelist` to `purge.options.safelist`

This allows us to have a similar API in `AOT` and `JIT` mode.

* only proxy `purge.safelist` to `purge.options.safelist` if
`purge.options.safelist` doesn't exists yet.
2021-06-09 10:00:09 -04:00
Brad Cornes
3569d49f7e
fix cli purge option when using commas (#4578) 2021-06-08 06:32:50 -04:00
Adam Wathan
40645d7dca Rename --files option in CLI to --purge 2021-06-07 14:01:59 -04:00
Robin Malfait
63a67cb8ef
improve integration tests (#4572)
* remove unused file

using syntax.js instead

* add a way to remove files that are generated from the tests

Essentially setting the restore cache contents to `null` as a special
value.

* combine the stdout and stderr output

* add jest-diff instead of relying on it existing *somewhere*

This also came with a small API change.

* add `--runInBand` to the test script

* add dedicated cli tests for the new Tailwind CLI
2021-06-07 13:50:53 -04:00
Brad Cornes
f1e31682c8
cleanup old contexts in config hash map (#4571) 2021-06-07 13:49:38 -04:00
Adam Wathan
67ee5e033d Write to stdout in watch mode if no output file provided 2021-06-05 16:38:54 -04:00
Adam Wathan
bd20d2c0fa Don't reassign configPath 2021-06-04 12:52:53 -04:00
Adam Wathan
77ef1dba15 Update CHANGELOG 2021-06-04 12:36:41 -04:00
depfu[bot]
c19336ccde
Update all of jest to version 27.0.2 (#4525)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2021-06-04 11:47:17 -04:00
Adam Wathan
cb48248552 Remove existing CLI 2021-06-04 11:44:28 -04:00
Adam Wathan
b9dd8b0a6d
Add peer variant (#4556) 2021-06-04 10:32:49 -04:00
Adam Wathan
746a12602e
Improve new JIT-compatible CLI (#4558)
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2021-06-04 10:28:09 -04:00
Adam Wathan
05d26a5d43 Make createContext arguments optional
For Brad!
2021-06-03 11:08:04 -04:00
Adam Wathan
65fde59f6a
Make it possible to enable caretColor and content core plugins in AOT mode (#4548)
* Fix issue where disabled corePlugins can't be re-enabled

* Disable caretColor and content core plugins by default, enable in JIT

* Don't disable caretColor/content in default config stub, hard-code for AOT instead

But with ability to still opt-in through your own config. Somewhat messy, but goal is to keep the messes in the AOT path and keep the JIT path pure.

* Fix style

* Revert unnecessary changes

* Fix style
2021-06-03 15:27:22 +02:00
Robin Malfait
d6b11b3807
Group variant stacking (#4551)
* make group variant stacking work

* simplify stacking group variants
2021-06-03 15:25:46 +02:00
Brad Cornes
a3db3a4700
Register PurgeCSS content as PostCSS dependencies (#4543)
* add `glob` property to `dir-dependency` messages

* Add `glob` to `dir-dependency` messages

* register purge content as postcss dependencies
2021-06-03 05:41:32 -04:00
depfu[bot]
1e48728efc Update autoprefixer to version 10.2.6 2021-06-02 15:03:24 +00:00
Brad Cornes
739c0fb83e
Add glob property to dir-dependency messages (#4539)
* add `glob` property to `dir-dependency` messages

* Add `glob` to `dir-dependency` messages
2021-06-02 08:59:14 -04:00
Adam Wathan
271338192c Update CHANGELOG 2021-06-02 08:57:18 -04:00
depfu[bot]
72d09b20d5 Update object-hash to version 2.2.0 2021-06-02 09:43:02 +00:00