1442 Commits

Author SHA1 Message Date
Peter Etelej
65617085c1
Fix pathname parsing for tracked files (#5008)
The trackedModified call in the tracking logic has a bug that
incorrectly removes `null` from pathnames

Currently:
```
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')
```
Where if `parsed.hash` or `parsed.search` are missing (which is
mostly the case for FS files), the value is null
eg `{ hash: null, search: null}`
  - In which case, we essentially trim `null`
converting `/mypath/nulldir/file.js` -> `/mypath/dir/filejs` and
breaking builds (see #4920 ).

Fix checks if `hash` or `search` are set before replacing them

Fixes #4920
2021-08-27 16:12:06 +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
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
José Valim
b280378c33
Abort the watcher if stdin is closed to avoid zombie processes (#4997)
* Abort the watcher if stdin is closed to avoid zombie processes

* Apply suggestions from code review
2021-08-23 14:35:28 -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
Adam Wathan
cbf3da0444
Hotfix: Use universal selector again (#5060) 2021-07-23 07:47:11 -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
Nestor Vera
cc4aaaaa49
Add new utility for align-self: baseline (#5000) 2021-07-17 15:19:14 -04:00
moonrailgun
b16afc9467
fix: mergeWith callback should process undefined case (#4843) 2021-07-02 16:55:32 -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
Robin Malfait
f4ea2cf77d
Cleanup leftover layers (#4853)
* update snapshots with correct version

* add test that verifies @layer is removed correctly

* cleanup leftover `@layer` nodes
2021-07-01 06:34:11 -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
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
schelmo
973d53d6dc
fix: do not return the userConfigPath if its null (#4773) 2021-06-23 14:12:42 -04:00
Arnout Roemers
aefd5f71cb
Enable purging when --purge option is supplied in CLI (#4772)
Do not require NODE_ENV to be set to 'production' as well, as using
the --purge option in the CLI should be explicit enough.

Co-authored-by: Arnout Roemers <roemers@zorgdomein.nl>
2021-06-23 14:12:06 -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
8da840f2a3 Add LICENSE for preflight
Preserves original license from suitcss-base, since Preflight was originally forked from that project.
2021-06-20 15:09:26 -04:00
Adam Wathan
359252c9b4 Pass colors to theme closures 2021-06-19 14:31:37 -04:00
Adam Wathan
1d72dc2699
Error when dash is used as custom separator (#4704) 2021-06-18 16:01:38 -04: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
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
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
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
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
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
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