90 Commits

Author SHA1 Message Date
Robin Malfait
1cbb29faeb
Remove the watching context (#6858)
* remove watching context

* update changelog
2022-01-03 17:45:31 +01:00
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
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
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
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
Brad Cornes
477dd06ec3
Resolve purge paths (#4214)
* resolve purge paths

* add test for purgecss pattern resolution

* resolve purgecss patterns relative to the config file if there is one

* account for raw content when transforming purgecss options

* append test name to postcss `from` option in purge tests
fixes tests hanging

* add test for relative purge path resolution in JIT mode
2021-05-07 13:46:19 -04:00
Robin Malfait
bfc61625d9
[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-04-30 10:58:40 -04:00
Adam Wathan
44505df53f Add PostCSS 7 support (maybe) 2021-04-02 14:34:50 -04:00
Adam Wathan
e8adab7ebb Only warn about JIT engine once 2021-04-02 14:34:50 -04:00
Adam Wathan
db2c661048 Add mode option to use JIT code path 2021-04-02 14:34:50 -04:00
Nate Moore
e86b586f4b
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-02-07 14:50:21 -05:00
Adam Wathan
729b400a68 Upgrade to PostCSS 8 2020-11-15 16:13:48 -05:00
Adam Wathan
b8344ab7fe Revert "Upgrade to PostCSS 8"
This reverts commit 59aa484dfea0607d96bff6ef41b1150c78576c37.
2020-11-05 07:39:11 -05:00
Adam Wathan
59aa484dfe Upgrade to PostCSS 8 2020-10-30 08:55:33 -04:00
Adam Wathan
c7c5262609
Downgrade PostCSS (#2629)
Switch back to v7 until closer to release, other tools are lagging behind and it is hurting compatibility.
2020-10-20 20:47:16 -04:00
depfu[bot]
a1b9548563
Upgrade postcss: 7.0.32 → 8.1.1 (major) (#2593)
* Update postcss to version 8.1.1

* Update main plugin format for PostCSS 8

* Move postcss to peerDependencies

* Remove postcss from dependencies

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2020-10-16 16:57:21 -04:00
Adam Wathan
38b4eeb288 Prettier likes parens a lot now
git blame is now broken forever.
2020-10-16 15:39:44 -04:00
Adam Wathan
b299b6fbe1
Support new presets key + extending core plugins config (#2474)
* WIP

* Support array for Tailwind config

* Drop array format for `presets` key instead

* Update changelog
2020-10-08 11:21:39 -04:00
Adam Wathan
e5c193a76c
Make resolveConfig compatible with feature flag configs (#2347)
* Make resolveConfig compatible with feature flag configs

* Update changelog
2020-09-07 19:56:35 -04:00
Adam Wathan
30a4e513ef
Rename hairline and thin font weights to thin and extralight (#2333)
* Add standardFontWeights flag for update thin/extralight font weight names

* Update changelog
2020-09-06 07:06:58 -04:00
Adam Wathan
02eb6a695c
Fix issue where dark mode experiment won't work if user has plugins array in config (#2322) 2020-09-04 19:58:02 -04:00
Adam Wathan
5701d7847b
Add dark mode variant (#2279)
* Initial dark mode prototype

* Isolate dark mode logic to config extension

* Update fixtures

* Fix lint warnings
2020-09-01 13:16:00 -04:00
Keunbae Park
15bcb8bf18 fix missing return 2020-08-27 13:05:06 -04:00
Adam Wathan
aa810673f4 Add experimental extendedFontSizeScale 2020-08-07 15:10:10 -04:00
Adam Wathan
4d2e4119fd Add experimental default line heights 2020-08-07 14:42:43 -04:00
Adam Wathan
30980063e8 Add experimental extended spacing scale 2020-08-07 11:25:22 -04:00
Adam Wathan
61635f4884 Co-locate feature flag utilities 2020-08-06 16:02:09 -04:00
Adam Wathan
1ac5874732 Add scaffolding for future/experimental flags, with WIP new color palette as example 2020-08-05 14:02:43 -04:00
Adam Wathan
5b18ef475a Silence jest warnings about mutating require cache 2020-04-29 16:37:03 -04:00
Adam Wathan
53dff626a7 Fix style 2019-10-12 13:41:28 -04:00
Adam Wathan
65d45689ae Allow plugins to provide their own config object 2019-10-12 13:40:00 -04:00
Adam Wathan
4c25ca5ed6 Apply config modifications to default config, before resolving config 2019-10-12 13:05:08 -04:00
Adam Wathan
e130771c32 Allow plugins to modify the config 2019-10-12 13:04:02 -04:00
Serhii Pashchenko
4a15678abb Make dependencies of config watchable 2019-08-11 12:32:46 +03:00
Adam Wathan
0bf8495b96 Support passing config object under config key 2019-08-02 08:31:46 -04:00
Adam Wathan
5cad3910fd Support passing empty object to signal 'use default config path' 2019-08-02 08:14:07 -04:00
Adam Wathan
649fb8f21e Support passing config path via object 2019-08-02 08:07:42 -04:00
Adam Wathan
93184084c6 Rename formatNodes to formatCSS 2019-04-17 08:07:42 -04:00
Adam Wathan
c98cc12d35 Remove dependency on perfectionist, implement simple formatting from scratch 2019-04-16 11:43:17 -04:00
Matt Stypa
6c461706c6 Moved constants and used it for hardcoded paths 2019-03-15 07:08:34 -05:00
Matt Stypa
9e4f54a17f Merging in changes from upstream 2019-03-14 18:07:29 -05:00
mattstypa
92b3b0c0a1 Updated CLI init commend 2019-03-14 15:51:21 -05:00
Adam Wathan
8fa379a995 Remove super old deprecation error 2019-03-14 15:20:06 -04:00
Adam Wathan
6a592930a4 Simplify ternary to or statement 2019-03-05 07:41:26 -05:00
Adam Wathan
7ade6ea744 Load tailwind.config.js automatically if present 2019-03-04 16:27:38 -05:00
Adam Wathan
04e1274e86 Rename mergeConfig to resolveConfig
Accept configs to resolve as an array to allow reuse when only resolving from a single config, update processTailwindFeatures to use resolveConfig even when no config is provided, update defaultTheme to self-reference colors.
2019-02-05 20:36:54 -05:00
Adam Wathan
d82a7556c0 Preserve units for zero value properties 2018-08-14 13:37:08 -04:00
Adam Wathan
7201c4f51b Rename lazyConfig to getConfig 2018-07-16 08:37:23 -04:00
Adam Wathan
9b22ff3513 Only process plugins once 2018-06-26 13:44:47 -04:00
Adam Wathan
b21d258f63 Wrap Tailwind plugins in new plugin to only unwrap config once 2018-06-26 13:44:47 -04:00