Commit graph

4819 commits

Author SHA1 Message Date
Jordan Pittman
215e86f0f3 Add prototype using lightningcss for minification
fixup
2022-09-22 09:34:06 -04:00
Jordan Pittman
9735d8d82a cleanup 2022-09-22 09:34:06 -04:00
Jordan Pittman
78eea5bee0 wip 2022-09-22 09:34:03 -04:00
Jordan Pittman
59fc32e3ad wip 2022-09-22 09:34:01 -04:00
Jordan Pittman
20ab1b3c64 wip 2022-09-22 09:33:56 -04:00
Jordan Pittman
9ac928b92c wip 2022-09-22 09:33:52 -04:00
Jordan Pittman
a15bee463f wip 2022-09-22 09:33:49 -04:00
Jordan Pittman
1d84e5b734 wip 2022-09-22 09:33:49 -04:00
Jordan Pittman
3871cc54ea wip 2022-09-22 09:33:47 -04:00
Jordan Pittman
056d18022a Normalize and resolve content paths earlier
Not just for PostCSS dependencies
2022-09-22 09:33:39 -04:00
Jordan Pittman
383354c478 Resolve symlinks for paths 2022-09-22 09:33:39 -04:00
Jordan Pittman
91ddcedb37 Add flag to resolve content relative to the config file 2022-09-22 09:33:39 -04:00
Jordan Pittman
4bff7654f5 Refactor parseDependency 2022-09-22 09:33:39 -04:00
Jordan Pittman
04132c33ca Add option to load config file relative to the input file 2022-09-22 09:33:39 -04:00
Jordan Pittman
9dec4f28ef Tweak formatting 2022-09-22 09:33:39 -04:00
Jordan Pittman
eed0e8b92b Update lockfile 2022-09-15 13:52:33 -04:00
Jordan Pittman
4e623343e4
Revert "Only listen for stdin close on TTYs (#8523)" (#9331)
* Revert "Only listen for stdin close on TTYs (#8523)"

This reverts commit 14f6574318.

* Update changelog
2022-09-14 16:06:34 -04:00
Jordan Pittman
8fe6f4868e
Don't emit utilities containing invalid theme fn keys (#9319)
* Don't emit utilities containing invalid theme keys

* Update changelog
2022-09-14 13:27:01 -04:00
Robin Malfait
527031d5f6
Improve data type analyses for arbitrary values (#9320)
* improve split logic by delimiter

The original RegEx did mostly what we want, the idea is that we wanted
to split by a `,` but one that was not within `()`. This is useful when
you define multiple background colors for example:
```html
<div class="bg-[rgb(0,0,0),rgb(255,255,255)]"></div>
```

In this case splitting by the regex would result in the proper result:
```js
let result = [
  'rgb(0,0,0)',
  'rgb(255,255,255)'
]
```

Visually, you can think of it like:
```
    ┌─[./example.html]
    │
∙ 1 │   <div class="bg-[rgb(0,0,0),rgb(255,255,255)]"></div>
    ·                       ──┬── ┬    ─────┬─────
    ·                         │   │         ╰─────── Guarded by parens
    ·                         │   ╰───────────────── We will split here
    ·                         ╰───────────────────── Guarded by parens
    │
    └─
```

We properly split by `,` not inside a `()`. However, this RegEx fails
the moment you have deeply nested RegEx values.

Visually, this is what's happening:
```
    ┌─[./example.html]
    │
∙ 1 │   <div class="bg-[rgba(0,0,0,var(--alpha))]"></div>
    ·                         ┬ ┬ ┬
    ·                         ╰─┴─┴── We accidentally split here
    │
    └─
```
This is because on the right of the `,`, the first paren is an opening
paren `(` instead of a closing one `)`.

I'm not 100% sure how we can improve the RegEx to handle that case as
well, instead I wrote a small `splitBy` function that allows you to
split the string by a character (just like you could do before) but
ignores the ones inside the given exceptions. This keeps track of a
stack to know whether we are within parens or not.

Visually, the fix looks like this:
```
    ┌─[./example.html]
    │
∙ 1 │   <div class="bg-[rgba(0,0,0,var(--alpha)),rgb(255,255,255,var(--alpha))]"></div>
    ·                         ┬ ┬ ┬             ┬       ┬   ┬   ┬
    ·                         │ │ │             │       ╰───┴───┴── Guarded by parens
    ·                         │ │ │             ╰────────────────── We will split here
    ·                         ╰─┴─┴──────────────────────────────── Guarded by parens
    │
    └─
```

* use already existing `splitAtTopLevelOnly` function

* add faster implemetation for `splitAtTopLevelOnly`

However, the faster version can't handle separators with multiple
characters right now. So instead of using buggy code or only using the
"slower" code, we've added a fast path where we use the faster code
wherever we can.

* use `splitAtTopLevelOnly` directly

* make split go brrrrrrr

* update changelog

* remove unncessary array.from call

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-09-14 14:08:56 +02:00
depfu[bot]
3e6b8ac6e5
Update esbuild to version 0.15.7 (#9306)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2022-09-12 23:01:27 +02:00
Jordan Pittman
454682bcac mayhaps fix insiders workflow? 2022-09-12 15:26:32 -04:00
Jordan Pittman
01f928d6de
Handle variants in utility selectors using :where() and :has() (#9309)
* Replaces classes in utility selectors like :where and :has

* Update changelog

* wip
2022-09-12 15:08:31 -04:00
Jordan Pittman
f92b31b12f Fix insiders release workflow 2022-09-12 15:06:39 -04:00
Brandon McConnell
cc1be47a4f
Add support for visibility: collapse with new collapsed utility (#9181)
* Add support for `visibility: collapse` with new `collapsed` utility

* fixup

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-09-09 13:19:24 -04:00
Jordan Pittman
d6bec49934
Fix parallel variant ordering clash (#9282)
* Remove remnants of the user layer

It hasn’t been used in a while

* Rewrite sort offset generation

* wip

* wip

wip

* Handle parasite utilities

* wip

* wip

* Make parallel variants sorting more resillient

It’s not perfect but it’s close

* fix

* remove todo

it adds a new bit so it can’t

* Simplify getClassOrder usage

* Simplify

oops

oops

* Add parasite utility for `dark`

dark mode class name

* Cleanup

* Cleanup

* Simplify

* format files

* Fix prettier plugin to use git build of Tailwind CSS

Symlink and build instead of adding a recursive dev dependency

It breaks node < 16

* Fix prettier error

* wip

* fix test

* Update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-09-09 13:12:43 -04:00
Remco Haszing
88e98f557c
Fix issue with Tailwind modifying global state (#9294)
* Fix issue with Tailwind modifying global state

When running Tailwind, it modifies the plugin defaults parameters. As a
result Tailwind using a Tailwind plugin in the same process twice yields
different results.

* Add failing test

* Undo defaults change

* wip

* Fix shared mutation problem

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-09-09 11:45:25 -04:00
Jordan Pittman
db50bbbc71
Handle variants on complex selectors (#9262)
* Handle variants on complex selector utilities

* Update changelog
2022-09-06 12:58:38 -04:00
depfu[bot]
09f38d2964 Update eslint to version 8.23.0 2022-09-02 22:47:02 +00:00
Jordan Pittman
17b81b4150
Allow negating utilities using min/max/clamp (#9237)
* Allow negating utilities using min/max/clamp

* Update changelog
2022-09-01 12:15:23 -04:00
Jordan Pittman
8b1bf8006d
CLI: Ignore watch events for files that don't match globs (#9215)
* Don’t re-add files in the CLI watcher that are covered by dynamic patterns

They don’t have the same problem. As long as the parent directory is watched their add/change events will fire correctly

* Ignore raw events for files that don’t match the content files

* fixup

* Update changelog
2022-08-31 12:59:56 -04:00
Brad Cornes
edf47a012d
Fix theme(fontFamily.*) when family contains fontFeatureSettings config (#9217) 2022-08-30 17:18:41 +01:00
Brad Cornes
914a4b6228
Update CHANGELOG.md 2022-08-30 12:23:54 +01:00
Brad Cornes
bcf14b1e1b
Fix fontFamily config types (#9214) 2022-08-30 12:22:15 +01:00
depfu[bot]
d6e6ff6f34 Update @swc/core to version 1.2.244 2022-08-30 05:29:11 +00:00
Jordan Pittman
c601fea37e Remove classCache check
It’s no longer necessary. If we have an entry in the `candidateRuleCache` then it’ll also be in the class cache and vice-versa. Also, we weren’t adding rules when hitting that cache like we should’ve been.
2022-08-29 15:03:40 -04:00
Jordan Pittman
58cc7ed3e8
Re-use existing entries in the rule cache (#9208)
* Add test

* Reuse rule cache entries when possible

* Update changelog
2022-08-29 14:13:32 -04:00
Augustine Calvino
da850424dc
fix safelist variant key required by typings (#9200) 2022-08-28 19:00:22 +02:00
Jordan Pittman
b0a549923f Handle when watchedPath is a file and not directory 2022-08-26 14:35:08 -04:00
Jordan Pittman
ad7dbda7e9
Fix CLI not watching atomically renamed files (#9173)
* Fix CLI not watching atomically renamed files

Chokdar should take care of this itself but sometimes it doesn’t do so OR is otherwise very sensitive to timing problems

* Force chokidar to always check for atomic writes

* Handle repeated atomic saves by retrying file reads

* Update changelog
2022-08-26 12:47:00 -04:00
Brad Cornes
7b6ac54ec8
Trigger Tailwind Play update after publishing insiders build (#9191) 2022-08-26 16:28:53 +01:00
Damian Głowala
28c7281193
Update preflight.css (#9190) 2022-08-26 11:19:07 -04:00
Jordan Pittman
7f93550e63
Honor the hidden attribute on elements in preflight (#9174)
* Honor the `hidden` attribute on elements

You’ll still be able to override this with utilities but this ensures that things like `<iframe hidden>` work as expected

* Update changelog
2022-08-24 17:05:44 -04:00
Adam Wathan
cef02e2dc3
Update CHANGELOG.md 2022-08-21 09:38:53 -04:00
Mosaad
e6fe4edb54
Remove invalid .outline-hidden (#9147) 2022-08-21 09:37:46 -04:00
depfu[bot]
bd46d0dce8 Update cssnano to version 5.1.13 2022-08-19 18:13:17 +00:00
Justin Wong
9d495b9ed0
Implement negative outline offsets (#9136)
* Implement negative outline offsets

* Update changelog
2022-08-19 06:32:18 -04:00
Adam Wathan
720be91466
Update CHANGELOG.md 2022-08-19 06:31:36 -04:00
Jordan Pittman
7924e7b40c Don’t replace all instances of the same class
This isn’t 100% correct either so we’re backing out this change
2022-08-15 16:05:47 -04:00
Jordan Pittman
ef74fd3db6
Fix @apply selector rewriting when multiple classes are involved (#9107)
* Rewrite `replaceSelector` using `postcss-selector-parser`

* Sort classes between tags and pseudos when rewriting selectors

* Update changelog
2022-08-15 14:43:41 -04:00
Jordan Pittman
b0018e20bf
Add future flag to disable color opacity utility plugins (#9088)
* Add future flag to disable opacity utility plugins

This will become the default in Tailwind CSS v4.0

* Update changelog
2022-08-15 13:45:02 -04:00