4407 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
b9af5a916b
Improve collapsing of duplicate declarations (#6856)
* improve collapsing of duplicate properties

In theory, we don't have to do anything because the browser is smart
enough to figure everything out. However, leaving in duplicate
properties is not that ideal for file size.

Our previous method was pretty simple: if you see a declaration you
already saw in this rule, delete the previous one and keep the current
one.

This works pretty well, but this gets rid of **all** the declarations
with the same property. This is not great for overrides for older
browsers.

In a perfect world, we can handle this based on your target browser but
this is a lot of unnecessary complexity and will slow things down
performance wise.

Alternative, we improved the solution by being a bit smarter:
1. Delete duplicate declarations that have the same property and value
   (this will get rid of **exact** duplications).
2. Delete declarations with the same property and the same **unit**.

This means that we will reduce this:
```css
.example {
  height: 50%;
  height: 100px;
  height: 20vh;
  height: 30%;
  height: 50px;
  height: 30vh;
  transform: var(--value);
  transform: var(--value);
}
```

To:
```diff-css
  .example {
-   height: 50%;    /* Another height exists later with a `%` unit */
-   height: 100px;  /* Another height exists later with a `px` unit */
-   height: 20vh;   /* Another height exists later with a `vh` unit */
    height: 30%;
    height: 50px;
    height: 30vh;
-   transform: var(--value); /* Value is too complex, but is **exactly** the same as the one below */
    transform: var(--value);
  }
```

This will reduce the values that we are 100% sure that can be safely
removed. This will still result in some overrides but the browser can
handle those for you.

Fixes: #6844

* update changelog
2022-01-03 15:41:49 +01:00
Robin Malfait
3149738035
Properly detect theme() value usage in arbitrary properties (#6854)
* properly detect theme value in arbitrary properties

* update changelog
2022-01-03 13:12:43 +01:00
Robin Malfait
c912434e0b
Validate theme() works in arbitray values (#6852)
* add tests to ensure theme value inside arbitrary values work

* update changelog
2022-01-03 11:29:18 +01:00
Robin Malfait
b341813d3f
Ensure we can use < and > characters in modifiers (#6851)
* ensure we can use "special" characters in modifiers

Fixes: #6778

* update changelog
2022-01-03 11:17:58 +01:00
Robin Malfait
875c850b37
Improve DEBUG parsing: only take care of tailwindcss and not tailwind (#6804)
* only take care of `tailwindcss` and not `tailwind`

* update changelog
2021-12-30 16:41:23 +01:00
Robin Malfait
10710b08b9
Improve DEBUG flag (#6797)
* improve DEBUG flag

* update changelog
2021-12-29 23:51:30 +01:00
depfu[bot]
07c3e95322 Update jest to version 27.4.5 2021-12-29 14:15:05 +00:00
Adam Wathan
a1c7868340 Update changelog 2021-12-28 16:17:29 -05:00
Adam Wathan
49f76ed23a 3.0.8 v3.0.8 2021-12-28 16:10:13 -05:00
Adam Wathan
bc82352b95 Update changelog 2021-12-28 16:09:58 -05:00
Philipp Schmid
2317533a57
Add standalone-cli node16-linux-arm64 build (#6693) 2021-12-28 16:06:49 -05:00
depfu[bot]
5b72a064c5 Update cssnano to version 5.0.14 2021-12-27 13:03:18 +00:00
depfu[bot]
2de4308b59 Update @swc/jest to version 0.2.15 2021-12-27 11:00:03 +00:00
depfu[bot]
8776db71da Update postcss to version 8.4.5 2021-12-25 15:13:37 +00:00
Adam Wathan
c40b0552df Update changelog 2021-12-24 13:21:18 -05:00
Adam Wathan
1d5aa27e79
Support HSL with hue units in arbitrary values (#6726) 2021-12-24 13:20:35 -05:00
Adam Wathan
da7396cf77 Sketching out more specific tests for our default extractor 2021-12-24 12:56:53 -05:00
depfu[bot]
7114fa96d9 Update prettier to version 2.5.1 2021-12-23 14:14:50 +00:00
depfu[bot]
66412062b8 Update @swc/cli to version 0.1.55 2021-12-22 04:29:00 +00:00
Jonathan Reinink
c0cd979e0f
Update CHANGELOG.md 2021-12-21 10:49:11 -05:00
Jonathan Reinink
808e69b360
Reduce specificity of abbr rule in preflight (#6671) 2021-12-21 10:47:24 -05:00
Robin Malfait
e8e64f0ff4
use better name 2021-12-17 22:28:58 +01:00
Jonathan Reinink
b8f010a9ef
Update logo in readme 2021-12-17 15:25:53 -05:00
Jonathan Reinink
575fb4cf3e Add logos for readme 2021-12-17 14:58:52 -05:00
Robin Malfait
0c10621414
3.0.7 v3.0.7 2021-12-17 18:42:22 +01:00
Robin Malfait
325a8e85c7
update changelog 2021-12-17 18:42:12 +01:00
Robin Malfait
86e73b2063
Ensure @apply of a rule inside an AtRule works (#6594)
* ensure apply of rule inside atrule works

If that atrule happens to contain another rule that is technically
unrelated.

Co-authored-by: Jordan Pittman <jordan@cryptica.me>

* update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2021-12-17 18:40:20 +01:00
Robin Malfait
9e03a6800b
Improve jsx interpolation candidate matching (#6593)
* ensure that strangely used jsx with interpolation gets detected

Co-authored-by: Luke Warlow <projects@warlow.dev>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>

* update changelog

Co-authored-by: Luke Warlow <projects@warlow.dev>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2021-12-17 17:32:50 +01:00
Jordan Pittman
27c67fef43
Properly extract classes with arbitrary values in arrays and classes followed by escaped quotes (#6590)
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2021-12-17 10:15:36 -05:00
Robin Malfait
2fdbe108cb
Only generate variants for non-user layers (#6589)
* only generate variants for non-user layers

If you have the following css:

```css
@tailwind utilities;
.foo {
  color: red;
}
```

And you HTML looks like this:
```html
<div class="hover:foo"></div>
```

Then the output should _not_ generate a `.hover\:foo {}` class.

* ensure that you can apply user csss (without variants)

* update changelog
2021-12-17 14:49:07 +01:00
Robin Malfait
7089a80ea1
Improve circular dependency detection when using @apply (#6588)
* improve circular dependency detection when using `@apply`

I also changed the message to the same message we used in V2.

* update changelog
2021-12-17 13:39:32 +01:00
Jordan Pittman
6cf3e3e55f
Don't mutate custom color palette when overriding per-plugin colors (#6546) 2021-12-16 16:19:54 -05:00
Robin Malfait
4a5ba3779e
3.0.6 v3.0.6 2021-12-16 20:07:40 +01:00
Robin Malfait
a7a5a4f0b2
update changelog 2021-12-16 20:07:30 +01:00
depfu[bot]
dbfc16c1c7 Update postcss-selector-parser to version 6.0.7 2021-12-16 12:43:57 +00:00
Jonathan Reinink
ec911c73f0 Improve order of color properties in transition and transition-colors utilities 2021-12-15 14:09:27 -05:00
Jonathan Reinink
1c7a793c94 Update order of color properties in transition and transition-colors utilities 2021-12-15 13:49:13 -05:00
Felix Klein
9934174867
Add 'text-decoration-color' to default 'transition' and 'transition-colors' utilities (#6405)
* Add 'text-decoration-color' to default 'transition' and 'transition-colors' utilities

* Add 'text-decoration-color' to default 'transition' and 'transition-colors' utilities

* Delete tailwind-output-flagged.css

* Delete tailwind-output-important.css

* Delete tailwind-output-no-color-opacity.css

* Delete tailwind-output.css

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2021-12-15 13:44:51 -05:00
Robin Malfait
0783a4275e
remove unused fixture files 2021-12-15 18:13:09 +01:00
Robin Malfait
deb68d5816
Ensure all plugins are executed for a given candidate (#6540)
* remove early return so that all plugins are handled

We had an early return so that once a plugin was matched, that we could
stop running the code through the other plugins. However, in this case
we have an issue that user defined css is technically also a plugin.

This means that:
  - `bg-green-light`
Would check for:
  - `bg-green-light` (no hit, continue)
  - `bg-green` (Hit! Don't execute next plugins)
  - `bg` (This is the one that would have generated `bg-green-light`)

We tested this change and it doesn't seem to have an impact functionally
and also not really performance wise.

* update changelog
2021-12-15 18:07:26 +01:00
Jordan Pittman
08a07f6e02
Support square bracket notation in paths (#6519) 2021-12-15 11:09:29 -05:00
Jonathan Reinink
fb545bc94d
Update CHANGELOG.md 2021-12-15 07:34:36 -05:00
Robin Malfait
3c93379565
3.0.5 v3.0.5 2021-12-15 13:04:48 +01:00
Robin Malfait
977e806ad2
update changelog 2021-12-15 13:04:39 +01:00
Robin Malfait
9777562da3
revert reset of li 2021-12-15 13:03:00 +01:00
Robin Malfait
a2fe0c4501
update changelog 2021-12-15 12:46:31 +01:00
Robin Malfait
ee557704b5
3.0.4 v3.0.4 2021-12-15 12:35:44 +01:00
Robin Malfait
8be5f7888d
update changelog 2021-12-15 12:35:38 +01:00
Robin Malfait
083bca3d3f
Insert always on defaults layer in correct spot (#6526)
* insert in correct spot

We were injecting the always on `@tailwind defaults` layer at the beginning of
the file. However, if a `@tailwind base` layer is available, then that
will now be injected _after_ the defaults layer. The base layer does
contain some reset that are now overriding the defaults we set.

So now we will:
- Insert the `@tailwind defaults` layer at the beginning of the file
  _if_ there is no `@tailwind base`
- Insert the `@tailwind defaults` layer after the `@tailwind base` layer
  if it exists.

* update changelog
2021-12-15 12:34:53 +01:00