4235 Commits

Author SHA1 Message Date
Luke Warlow
f2d2a0e3cd
Add min-content and max-content utilities for (min/max) height (#5729) 2021-10-07 09:13:50 -04:00
Brad Cornes
30b76cf472 Use join instead of resolve and update path import
This fixes `pkg` bundling
2021-10-07 12:49:32 +01:00
Brad Cornes
5b4baea1d6 Use path.resolve instead of string concatenation
This allows the path to be statically analysed when bundling, for example with `pkg`
2021-10-07 12:33:23 +01:00
Robin Malfait
ee0f32908d
Ensure we log flag notices (#5726) 2021-10-07 12:52:53 +02:00
Luke Warlow
31a9860fe5
Add fit-content utilities for (min/max) height and width (#5638) 2021-10-07 06:08:22 -04:00
depfu[bot]
579e922fc8 Update glob-parent to version 6.0.2 2021-10-06 22:27:47 +00:00
Adam Wathan
6ce8864f47 Update changelog 2021-10-06 13:42:49 -04:00
Adam Wathan
97062c398b
Make negative values a first-class feature, rather than theme-driven (#5709)
* WIP

* Add failing test for negating default values

* Add dynamic negative value opt-in (#5713)

* Add `supportsNegativeValues` plugin option

* Update `getClassList` to support dynamic negative values

* Add test for using a negative scale value with a plugin that does not support dynamic negative values

* Support dynamic negation of `DEFAULT` values (#5718)

* Add test case

Co-authored-by: Brad Cornes <bradlc41@gmail.com>
2021-10-06 13:42:05 -04:00
Robin Malfait
b661614265
Enable optimize universal defaults by default (#5635)
* enabled `optimizeUniversalDefaults` by default

This PR is done in a way so that the default is set to `true`, but you
can still disable it if it causes issues. In this case we do appreciate
an issue in that case 😅.

* update tests to use optimized universal selector

* update integration tests

* add dedicated tests for the optimized universal selector

* improve minimumImpactSelector algorithm

I think I cracked the algorithm, but I will probably need another pair
of eyes on the subject.

The current implementation works like this:

Prerequisites:

- The selector should already have been parsed using the selectorParser
  from 'postcss-selector-parser'.

Algorithm:

1. Remove all of the pseudo classes from the list of nodes.
  1.1. We do want to keep pseudo elements (E.g.: `::before`, `::first-line`, ...)
  1.2. We do want to keep pseudo classes that contain nodes (E.g.:
    `:not(...)`)
2. Reverse the list of nodes.
  This will make it easier to search from the end to the start. For
  example `.group:hover .group-hover` should result in `.group-hover`
  not `.group`.
  2.1. Find the index of the best match (class, id, attribute), and
    convert the node if required. (E.g.: `span#app` -> `#app` => `[id="app"]`)
  2.2. Remove the rest of the selector that is not important anymore
  2.3. Re-join the left-over nodes together

* update tests using new algorithm

* also look for `tag` types

* take `tag` into account

* simplify logic

* add test to prove `rest.reverse()` in first case is required

In case we don't find a match (idx === -1), we use `rest.reverse()`.
However, it looks like you can just use `nodes` instead.
This is not entirely true, because the `rest` variable will contain only
the nodes that are not pseudo elements.

`*:hover` would result in `*:hover` instead of just `*`

* replace all nodes after > with a single universal selector
2021-10-06 17:45:26 +02:00
depfu[bot]
7b94feaef3 Update jest to version 27.2.4 2021-10-05 10:27:50 +00:00
Adam Wathan
cca75e67fb Update changelog 2021-10-04 15:53:52 -04:00
Adam Wathan
a2676b0544
Add flex-basis utilities (#5671) 2021-10-04 15:47:14 -04:00
depfu[bot]
778bd37838 Update is-glob to version 4.0.3 2021-10-03 22:57:43 +00:00
Adam Wathan
e362272631 Update changelog 2021-10-02 05:59:15 -04:00
depfu[bot]
abad3b1a10 Update @swc/core to version 1.2.92 2021-10-02 08:13:04 +00:00
Jonathan Reinink
d50b049ae5 Update changelog 2021-10-01 15:43:14 -04:00
Jonathan Reinink
6b26174921 Update changelog 2021-10-01 15:32:26 -04:00
Jonathan Reinink
ba06a102d2 Update changelog 2021-10-01 15:02:36 -04:00
Jonathan Reinink
53ae5d53d8 Update changelog 2021-10-01 13:45:41 -04:00
Robin Malfait
86b254abda
update integration tests for alpha version 2021-10-01 19:06:24 +02:00
Robin Malfait
c42ffc10a1
update integration tests for alpha version 2021-10-01 18:56:47 +02:00
Jonathan Reinink
95831fd2f8 Update changelog 2021-10-01 12:50:05 -04:00
Adam Wathan
ac98ff4753 3.0.0-alpha.1 v3.0.0-alpha.1 2021-10-01 11:56:49 -04:00
Adam Wathan
3eb4079d95
Update release.yml 2021-10-01 11:54:43 -04:00
Jonathan Reinink
b8cda161dd
Improve warnings (#5666) 2021-10-01 11:47:02 -04:00
depfu[bot]
55cf56476e Update autoprefixer to version 10.3.6 2021-10-01 15:42:56 +00:00
Robin Malfait
bd21bef99a
Polish match APIs (#5664)
* fix incorrect logic for validating content paths

* remove `includeRules` helper

* generate keyframes as part of the animate plugin

* add matchUtilities

* splitup `variantPlugins` and `corePlugins`
2021-10-01 17:31:09 +02:00
Robin Malfait
d94541cbf3
Handle old to new config when normalizing the config (#5658)
* immediately take the `safelist` values into account

Currently we had to manually add them in the `setupTrackingContext`,
`setupWatchingContext` and the `cli`.

This was a bit cumbersome, because the `safelist` function (to resolve
regex patterns) was implemented on the context. This means that we had
to do something like this:

```js
let changedContent = []
let context = createContext(config, changedContent)
for (let content of context.safelist()) {
  changedContent.push(content)
}
```

This just feels wrong in general, so now it is handled internally for
you which means that we can't mess it up anymore in those 3 spots.

* drop the dot from the extension

Our transformers and extractors are implemented for `html` for example.
However the `path.extname()` returns `.html`.

This isn't an issue by default, but it could be for with custom
extractors / transformers.

* normalize the configuration

* make shared cache local per extractor

* ensure we always have an `extension`

Defaults to `html`

* splitup custom-extractors test

* update old config structure to new structure

* ensure we validate the "old" structure, and warn if invalid

* add tests with "old" config, to ensure it keeps working

* add missing `content` object

* inline unnecessary function abstraction
2021-10-01 12:56:54 +02:00
Jonathan Reinink
109c1c563d Change color warning key 2021-10-01 06:44:05 -04:00
Brad Cornes
ba9d177891
Rename completions and remove color information (#5662) 2021-10-01 09:41:27 +01:00
Jonathan Reinink
84db333d46 Add warning about RTL features being in preview
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-30 21:18:31 -04:00
Jonathan Reinink
cd5cb00266
Implement one-time logging to prevent duplicate warnings (#5661)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-30 21:16:01 -04:00
Adam Wathan
61f881fca1 Remove darkMode from simpleConfig 2021-09-30 15:26:13 -04:00
Adam Wathan
601bc5fc43 Standardize default config to use unified callback argument syntax 2021-09-30 15:25:54 -04:00
Robin Malfait
11bfa0a9bd
Detect ambiguity in arbitrary values (#5634)
* detect ambiguity in arbitrary values

* update warning message
2021-09-30 12:39:41 +02:00
hardfist
ef9187566b
fix: improve negative proformance (#5652) (#5652) 2021-09-30 03:42:49 -04:00
Robin Malfait
39ccd06141
Fix fallback argument in CLI (#5646)
I don't know exactly what happened here, but it seems like I screwed
this trivial fallback up in a spectacular way... anyway, here to fix it!
2021-09-29 23:33:43 +02:00
Jonathan Reinink
71be5a10e9 Update changelog
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-29 10:32:46 -04:00
Jonathan Reinink
ca1dfd6313
Add border-x-{width}, border-y-{width}, border-x-{color} and border-y-{color} utilities (#5639)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-Authored-By: Davy <davy@prepr.io>
2021-09-29 10:32:31 -04:00
Jonathan Reinink
2c73dbcfa3 Update changelog
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-29 09:58:05 -04:00
Jonathan Reinink
753d3f146c
Add scroll-snap utilities (#5637)
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Peter Jonsson <4572231+95jonpet@users.noreply.github.com>
Co-authored-by: Enzo Innocenzi <enzo@innocenzi.dev>
2021-09-29 09:57:26 -04:00
Brad Cornes
484acb3f6b
Fix using backslashes in content globs (#5628)
* Normalize content globs

* Update changelog
2021-09-29 14:13:10 +01:00
Brad Cornes
0b23d2e1d2
Fix using negated content globs (#5625)
* Fix negated content patterns

* Update changelog
2021-09-29 11:15:31 +01:00
depfu[bot]
c5c644f315 Update postcss to version 8.3.8 2021-09-29 06:13:44 +00:00
Jonathan Reinink
4a2f9fb6d8 Update changelog 2021-09-28 14:18:31 -04:00
Jonathan Reinink
77307f5211
Resolve overflow-clip naming collision issue (#5630)
* Rename `overflow-clip` to `text-clip`, add `text-ellipsis`, deprecate `overflow-ellipsis`

Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

* Add `overflow-clip` utilities

Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-28 14:17:41 -04:00
Brad Cornes
2fb33ee578
Update package version import to allow for tree-shaking (#5629) 2021-09-28 17:09:16 +01:00
Jonathan Reinink
8004917618
Add [open] variant (#5627)
* Add `[open]` variant

Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-Authored-By: Sean Doyle <2575027+seanpdoyle@users.noreply.github.com>

* Add new `applyStateToMarker()` function

This function replaces the existing `applyPseudoToMarker()` and `applyAttributeToMarker()` functions.

Co-Authored-By: Robin Malfait <1834413+RobinMalfait@users.noreply.github.com>

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Sean Doyle <2575027+seanpdoyle@users.noreply.github.com>
Co-authored-by: Robin Malfait <1834413+RobinMalfait@users.noreply.github.com>
2021-09-28 11:13:58 -04:00
Robin Malfait
c30a32e430
Drop unused tailwindDirectives argument (#5624) 2021-09-28 12:00:27 +02:00
Robin Malfait
5d6d84fda1
Ensure full node stays, if only a partial is used (#5617) 2021-09-28 11:54:39 +02:00