79 Commits

Author SHA1 Message Date
Robin Malfait
691ed02f63
Remove AOT (#5340)
* make `jit` mode the default when no mode is specified

* unify JIT and AOT codepaths

* ensure `Object.entries` on undefined doesn't break

It could be that sometimes you don't have values in your config (e.g.: `presets: []`), this in turn will break some plugins where we assume we have a value.

* drop AOT specific tests

These tests are all covered by JIT mode already and were AOT specific.

* simplify tests, and add a few

Some of the tests were written for AOT specifically, some were missing. We also updated the way we write those tests, essentially making Tailwind a blackbox, by testing against the final output.
Now that JIT mode is the default, this is super fast because we only generate what is used, instead of partially testing in a 3MB file or building it all, then purging.

* add some todo's to make sure we warn in a few cases

* make `darkMode: 'media'`, the default

This also includes moving dark mode tests to its own dedicated file.

* remove PostCSS 7 compat mode

* update CLI to be JIT-first

* fix integration tests

This is not a _real_ fix, but it does solve the broken test for now.

* warn when using @responsive or @variants

* remove the JIT preview warning

* remove AOT-only code paths

* remove all `mode: 'jit'` blocks

Also remove `variants: {}` since they are not useful in `JIT` mode
anymore.

* drop unused dependencies

* rename `purge` to `content`

* remove static CDN builds

* mark `--purge` as deprecated in the CLI

This will still work, but a warning will be printed and it won't show up
in the `--help` output.

* cleanup nesting plugin

We don't have to duplicate it anymore since there is no PostCSS 7
version anymore.

* make sure integration tests run in band

* cleanup folder structure

* make sure nesting folder is available

* simplify resolving of purge/content information
2021-09-01 17:13:59 +02:00
Robin Malfait
97804a8950
Pin clean css version (#5338)
* pin clean-css to version `5.1.4`

* update fixtures
2021-08-30 13:00:50 +02:00
Adam Wathan
476d445629
Fix missing !important when using @apply (#4854)
* Add failing test for #4823

* Fix important variant `@apply`

Co-authored-by: Brad Cornes <bradlc41@gmail.com>
2021-08-27 16:08:25 +02:00
Robin Malfait
96ef15039b
Ensure purge tests work even for version mismatches (#5316)
We applied the same treatment for the sanity tests, where we ignore the
first line (the tailwind header).

An odd issue I have found is that diffing of big css files is _very_
slow. When te tests pass, then the first test takes `3302 ms`, however,
when it fails it takes `477482 ms` on my machine. That's almost 8
minutes.
2021-08-27 15:47:39 +02:00
Robin Malfait
baa8f6528b
Ensure nested [] is allowed (#5304)
This will allow us to write something like:

`grid-cols-[[linename],1fr,auto]`
2021-08-26 13:50:39 +02:00
Robin Malfait
fa3d454d06
Ensure arbitrary values only support valid values (#5293)
* ensure arbitrary values only support valid values

* ensure we validate balancing [], () and {}
2021-08-26 05:52:47 -04:00
Brad Cornes
5d0abea336
Fix object-position arbitrary values (#5245) 2021-08-20 22:40:11 -04:00
Brad Cornes
b56b4c0b14
[JIT] Support animation lists (#5252)
* Support animation lists

* Update tests
2021-08-20 22:39:06 -04:00
Brad Cornes
e1160e38ac
Skip escaped commas when splitting selector (#5239) 2021-08-17 20:06:31 -04:00
Brad Cornes
4ff383fbbe
Fix malformed keyframes when using class variants (#5223) 2021-08-16 12:25:30 -04:00
Adam Wathan
723e8d4377
Improve accessibility of default link focus styles in Firefox (#5082) 2021-07-31 07:10:17 -04:00
Robin Malfait
bfc9fa79d4
Improve tests (#5108)
* change specific selector to universal selector

This is the commit that we could "undo" in the future if we need it
again.

* simplify `relative-purge-paths` test

This test doesn't require the "reset" selector (whether it is super specific or universal)

Simplified it so that it tests the relative purge config and nothing else.

* added css tagged template literal helpers

This allows prettier to format the string as CSS. This improves formatting and will improve future diffs.

* drop tailwind headers in the sanity tests

Every time we bump the Tailwind version, the sanity tests fail, because
the current version is encoded in the fixture files.

This will ensure that all of the contents is still checked and the
header is skipped. The header will be tested against a regex to ensure
that it is still there.

This should be a small but nice QoL improvement, so that we don't have
to think about updating those tests whenever we fix bugs or land new
features.
2021-07-29 07:31:06 -04:00
Adam Wathan
f7e9831436 Update version in fixtures 2021-07-26 09:01:41 -04:00
Adam Wathan
90da0b3a7c Rebuild fixtures 2021-07-21 15:47:24 -04:00
Adam Wathan
a76fb7fb14
Fix issue where base styles not generated for translate transforms in JIT (#5038) 2021-07-21 15:42:38 -04:00
Adam Wathan
81f9e940b4 Update version in fixtures 2021-07-21 10:23:20 -04:00
Nestor Vera
cc4aaaaa49
Add new utility for align-self: baseline (#5000) 2021-07-17 15:19:14 -04:00
Adam Wathan
f20655c2d3
Fix backdrop opacity variants (#4892)
We weren't generating backdrop opacity variants properly due to a typo in the default config.
2021-07-04 09:50:14 -04:00
Adam Wathan
a3230307f3
Ensure [hidden] works as expected (#4873) 2021-07-02 09:14:03 -04:00
Adam Wathan
4a070ac0be
Try to use lowest impact selector when filling in defaults (#4866) 2021-07-01 17:18:46 -04:00
Sergey Tatarintsev
2166b76c53
Improve production build performance for the case of many small non-tailwind stylesheets (#4644)
* Improve `purge` performance in layers mode

In layers mode, skip `purgecss` completely if source stylesheet does
not have any tailwind layers. For the legacy codebases with a lot of
non-tailwind stylesheets, it dratically improves the performance of
the production build.

* fix: purgecss should respect safelist.variables
2021-07-01 14:25:06 -04:00
Adam Wathan
fe27356680
JIT: Optimize universal selector usage by inlining only the relevant selectors (#4850)
* WIP

* run prettier

* drop new lines in custom matcher

Drop all newlines, let prettier handle everything for us.

* add cache for the selector parser

* add `@apply` tests for the universal optimizer

* drop comments

* initial replacements

* WIP

* WIP

* MAKE IT WORK

* Rename to resolveDefaultsAtRules

* Update tests + defaults identifiers

* Don't add @defaults in AOT mode

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2021-07-01 06:33:37 -04:00
Adam Wathan
369c7b5f0c
Ensure resorted plugins take into account all plugins they need to sort relative to (#4852) 2021-07-01 05:59:47 -04:00
Adam Wathan
a6e79f9e85
Improve extractor for arbitrary values with quotes (#4817)
Fixes #4801.
2021-06-26 10:20:49 -04:00
Adam Wathan
59c7e32a3b
Ignore "!*" in templates (#4816)
Fixes #4746
2021-06-26 10:20:36 -04:00
Tim
fdfecf3b9c
Add step-start and step-and to timings constant (#4795)
Co-authored-by: Tim Kleyersburg <tk@wacg.de>
2021-06-24 10:49:57 -04:00
Adam Wathan
b3d5b4e000 Rebuild fixtures 2021-06-23 16:22:01 -04:00
Adam Wathan
91a441d458 Update fixtures 2021-06-23 15:25:46 -04:00
Adam Wathan
063eca6dc4
Remove outdated focus style fix (#4780)
* Remove outdated focus style fix from Preflight

* Update fixtures
2021-06-23 14:14:36 -04:00
Sachin Raja
c0ee52060c
Generate plugin list file (#4725)
* Generate plugin list file

Removes the importing of all plugins in src/util/resolveConfig to avoid importing CSS.
Import the built plugin list file instead.

* Use `process.cwd()` instead of `__dirname` to resolve path

Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>

* Import core plugin list in resolveConfig test

* Generate plugin list prebabelify and on install

* Move generation from install to postinstall

Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>

Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
2021-06-23 14:13:03 -04:00
Robin Malfait
0413b84c12
ensure peer variants don't include multiple ~ characters (#4757)
Fixes: #4726
2021-06-22 20:40:52 -04:00
Adam Wathan
1d72dc2699
Error when dash is used as custom separator (#4704) 2021-06-18 16:01:38 -04:00
Robin Malfait
f425661a90
rebuild fixtures 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
ea7b3f6189
rebuild fixtures 2021-06-18 15:42:18 +02:00
Adam Wathan
418d223837 Update fixtures 2021-06-17 14:45:44 -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
Adam Wathan
81816df3a1 Support arbitrary values for object-position 2021-06-14 16:03:14 -04: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
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
Adam Wathan
b86aa5c2a9
Remove need for transform toggle (#4604) 2021-06-10 09:15:41 -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
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
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
Adam Wathan
7264a5b71b
Generate group parent classes correctly with custom separator (#4508) 2021-05-30 15:02:55 -04:00
Adam Wathan
15642fbcc8 Compare adjacent rules ignoring whitespace 2021-05-30 14:55:30 -04:00