4822 Commits

Author SHA1 Message Date
depfu[bot]
22cd14e331 Update @swc/core to version 1.3.4 2022-10-03 10:49:08 +00:00
peter madsen
8de17cb648
add armv7 to build-cli.yml (#9460)
believe it's needed to complete the armv7 support added here:  4ff417c5b6
2022-10-01 15:32:03 +02:00
Robin Malfait
727de668fd
Improve type checking for formal syntax (#9448)
* Improve type checking for formal syntax

* Add test

* Change order of test class name

* fix failing tests

* prefer `position` over `size` for backwards compatibility reasons

Previously `bg-[10px_10%]` generated `background-position: 10px 10%` before we introduced the fallback plugins.
Therefore we should prefer `position` over `size` as the default for backwards compatibility.

* update changelog

* ensure correct order

Thanks Prettier!

* update changelog

Co-authored-by: lzt1008 <lzt1008@live.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: liangzhengtai <liangzhengtai_i@didiglobal.com>
2022-09-29 18:24:51 +02:00
Robin Malfait
94d6e7299a
Implement fallback plugins when arbitrary values result in css from multiple plugins (#9376)
* use test with non-any type plugin

* choose backgroundSize over backgroundPosition

Ensure that `backgroundColor` can take any value

* add tests to verify fallback plugins

* implement fallback plugins

Whenever an arbitrary value results in css from multiple plugins we
first try to resolve a falback plugin.

The fallback mechanism works like this:

- If A has type `any` and B has type `color`, then B should win.

  > This is because `A` will match *anything*, but the more precise type
    should win instead. E.g.: `backgroundColor` has the type `any` so
    `bg-[100px_200px]` would match both the `backgroundColor` and
    `backgroundSize` but `backgroundSize` matched because of a specific
    type and not because of the `any` type.
- If A has type `length` and B has type `[length, { disambiguate: true }]`, then B should win.
  > This is because `B` marked the `length` as the plugin that should
    win in case a clash happens.

* Add any type to a handful of plugins

Needs tests tho

* Add any type to `border-{x,y,t,r,b,l}` plugins

* Add test for any type

* Split on multiple lines

* fixup

* add tests for implicit `any` types

* rename `disambiguate` to `preferOnConflict`

* update tests to reflect `any` types a bit better

* update changelog

* annotate any-type test with a bit more information

Just for future debugging reasons!

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-09-29 17:26:27 +02:00
Jordan Pittman
52ab315439 Update changelog 2022-09-26 13:10:47 -04:00
Robin Malfait
26cab53c15
Support sort function in matchVariant (#9423)
* support `sort` function in `matchVariant`

This will ensure that we can sort arbitrary variant values (and
hardcoded values) to ensure the order.

* update changelog
2022-09-26 13:08:12 -04:00
depfu[bot]
19b86e62e0 Update eslint to version 8.23.1 2022-09-23 22:46:12 +00:00
Adam Wathan
6df8cd9c57
Update CHANGELOG.md 2022-09-23 14:13:36 -04:00
lightyen
d77b9cec18
Add fill-none and stroke-none utilities (#9403) 2022-09-23 14:12:57 -04:00
Jordan Pittman
5ea752e85c
Add @config support (#9405)
* Refactor CLI

* Add `@config` support

* Update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-09-23 13:48:17 -04:00
Jordan Pittman
bf44941049
Allow resolving content paths relative to the config file (#9396)
* Update lockfile

* Tweak formatting

* Refactor content path parsing

* Allow resolving content paths relative to the config file

* Include resolved symlinks as additional content paths

* Update changelog

* Work on suite of tests for content resolution

* reformat integration test list

* Move content resolution tests to integration

* Update future and experimental types
2022-09-23 08:09:02 -04:00
Jonathan Reinink
7ea02c2d34
Update CHANGELOG.md 2022-09-22 15:19:43 -04:00
k-utsumi
2574a881e5
Add break-keep utility (#9393)
*  Add `word-break: keep-all` with `keep-all`

ref. https://developer.mozilla.org/en-US/docs/Web/CSS/word-break

`whitespace-nowrap` and `word-break: keep-all` behave differently in different browsers.

Demo: https://jsfiddle.net/h1aj6nvy/

There is a difference between Firefox and Google chrome.

* Rename `keep-all` to `break-keep`

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2022-09-22 15:17:54 -04:00
Positive person
1d82327bc2
Update CHANGELOG.md (#9388)
Typo fix
2022-09-21 12:30:05 -04:00
Robin Malfait
e62525226e
Ignore unset values (like null or undefined) when resolving the classList for intellisense (#9385)
* ignored `undefined` and `null` value values for intellisense

We are not completely ignoring "all" falsey values, because then we
would get rid of `0` values (e.g.: `p-0`) which is not what we want.

* update changelog
2022-09-21 14:31:08 +02:00
depfu[bot]
063ca64f9f Update autoprefixer to version 10.4.11 2022-09-21 09:24:48 +00:00
Teddy Bradford
27aee8fc29
Replace color template literal with string (#9367) 2022-09-19 15:24:21 -04:00
Robin Malfait
4fddd2d611
Polish matchVariant API (#9313)
* convert the `matchVariant` to look more like `addVariant`

With the biggest difference that the `matchVariant` will have a callback
function that receives the current value of the variant.

* use object as argument for `matchVariant` callback

This will allow us to add more properties in the future if needed
without breaking changes.

- This is a breaking change: `(value) => ...` -> `({ value, other }) => ...`
- This is **not** a breaking change: `({ value }) => ...` -> `({ value, other }) => ...`

* add types for `matchVariant`
2022-09-16 15:37:35 +02:00
depfu[bot]
be429b75ce Update fast-glob to version 3.2.12 2022-09-16 10:29:03 +00: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 14f6574318b66f7df4d8767c2c70ecb73c4ee26d.

* 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