Commit graph

512 commits

Author SHA1 Message Date
Jordan Pittman
185250438c Remove variant dark mode strategy 2024-01-05 12:17:01 -05:00
Adam Wathan
2433d99716 Finish updating tests 2024-01-05 12:17:01 -05:00
Adam Wathan
aed8a36f26 Updating tests... 2024-01-05 12:17:01 -05:00
Adam Wathan
c221bbcaa9 Add simplified failing apply/where test case 2024-01-05 12:17:01 -05:00
Adam Wathan
13ad6ccabf Use class for legacy behavior, selector for new behavior 2024-01-05 12:17:01 -05:00
Jordan Pittman
c055aa4017 wip 2024-01-05 12:17:01 -05:00
Jordan Pittman
543dacf81a Add legacy dark mode option 2024-01-05 12:17:01 -05:00
Jordan Pittman
1544ef576d Add dark mode variant option 2024-01-05 12:17:01 -05:00
Jordan Pittman
47107be783
Don't add spaces to gradients and grid track names when followed by calc() (#12704)
* Don’t break gradient functions when following `calc()`

* Don’t break CSS grid track names

* Update changelog
2024-01-03 13:03:16 -05:00
Jordan Pittman
b048a0db80
Don't remove keyframe stops when using important utilities (#12639)
* Don't remove keyframe stops when using important utilities

* Fix test

* fix linting
2023-12-21 12:17:12 -05:00
Adam Wathan
af7e610aaa
Improve relative precedence of rtl, ltr, forced-colors and dark variants (#12584)
* Reduce specificity of `rtl`, `ltr`, and `dark` variants

Reduce specificity of `rtl`, `ltr`, and `dark` variants (when using `darkMode: 'class'`) to make them the same as other variants. This also sorts the LTR/RTL and dark variants later in the variant plugin list to ensure that the reduced specificity doesn't cause them to start "losing" to other variants to keep things as backwards compatible as possible.

Resolves a long-standing issue where `darkMode: 'media'` and `darkMode: 'class'` had different specificity, which meant switching your dark mode strategy could break your site.

* Update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-12-16 18:53:08 -05:00
Luke Warlow
fb85c8fd17
Move forced-colors variant after dark variant (#12582)
Also add test for the order of the forced-colors variant
2023-12-13 10:03:14 -05:00
Adam Wathan
cb9c64a6d2
Add * variant for targeting direct children (#12551)
* add `*` as child variant

* add `*` as allowed variant character

* update test to reflect Lightning CSS output

* add `childVariant` test

* Update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Co-authored-by: Gregor Kaczmarczyk <github@aggreggator.de>
2023-12-09 09:11:00 -05:00
Jordan Pittman
7385373c35
Fix support for container query utilities with arbitrary values (#12534)
* Fix support for container query utilities with arbitrary values

* Update changelog
2023-12-05 12:26:33 -05:00
Jordan Pittman
317fba1d6b
Fix source maps of variant utilities that come from an @layer rule (#12508)
* Refactor

* Keep traversing sibling nodes

* Make sure the root node has a source location for the end

* Add source map test for at-rule variants

* Update changelog
2023-12-01 11:05:34 -05:00
Jordan Pittman
3169d159ca
Fix generation of utilities that use slashes in arbitrary modifiers (#12515)
* Fix support for slashes in arbitrary modifiers

* Update changelog
2023-12-01 10:44:08 -05:00
Jordan Pittman
b2b37e04e4
Don't crash when given applying a variant to a negated version of a simple utility (#12514)
* Don't crash when given applying a variant to a negated version of a simple utility

* Update changelog
2023-12-01 10:22:45 -05:00
Ngô Quốc Đạt
bce0481f40
Add logical properties support for float and clear (#12480) 2023-11-27 09:12:58 -05:00
Jordan Pittman
79e57ecb49 Update sourcemaps 2023-11-16 15:39:05 +00:00
Jordan Pittman
0a2aea2c9b Update test 2023-11-16 15:39:05 +00:00
Jordan Pittman
b4f3cddb50 Remove uses of ::-webkit-backdrop 2023-11-16 15:39:05 +00:00
Adam Wathan
e5eceb3879
Add appearance-auto utility (#12404)
* Add `appearance-auto` utility

* Update CHANGELOG

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-11-12 11:22:35 -05:00
Robin Malfait
a5a61580cd
Improve candidate detection in minified JS arrays (without spaces) (#12396)
* add test to verify `["util1","util2"]` works

* update extractor regex, to reduce valid values in the arbitrary value part

Co-authored-by: Autom <mijnnaamis2112@hotmail.com>

* add special case with deeply nested `[]`

* update changelog

* move oxide changelog itemsto the bottom

---------

Co-authored-by: Autom <mijnnaamis2112@hotmail.com>
2023-11-10 23:06:02 +01:00
Luke Warlow
b411d04c8c
Add forced-colors variant (#11694)
* Add forced-colors variant

Also add a contrast-custom variant to match custom contrast preferences

* use `toMatchSnapshot` instead of `toMatchFormattedCss`

More info: https://github.com/tailwindlabs/tailwindcss/pull/12170

* remove `contrast-custom` variant

* move `forcedColorsVariants` next to `prefersContrastVariants`

* update changelog

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-11-02 20:28:50 +01:00
Luke Warlow
6353450a94
Add forced-color-adjust utilities (#11931)
* Add forced-colors-adjust utilities

* Update forcedColorsAdjust.test.js

* use `toMatchSnapshot` instead of `toMatchFormattedCss`

More info: https://github.com/tailwindlabs/tailwindcss/pull/12170

* rename `forced-colors-adjust` -> `forced-color-adjust`

Dropped the `s` in `colors`.

* update changelog

* fix typo

* use full `forced-color-adjust-auto` and `forced-color-adjust-none` names

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-11-02 17:48:11 +01:00
Tom
2d6856c8eb
Ensure configured font-feature-settings for mono are included in Preflight (#12342)
* Use the default font-feature-settings for mono

* Update changelog

* Update tests

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-11-02 10:57:35 -04:00
Jordan Pittman
0985d26a54
Don’t add spaces to negative numbers following a comma (#12324)
* Don’t add spaces to negative numbers following a comma

* Update changelog
2023-10-30 10:47:24 -04:00
Jordan Pittman
782c733b90
Add spacing scale to min-width, min-height, and max-width (#12300)
* Add spacing scale to `min-width`, `min-height`, and `max-width`

* Update snapshots

* Update changelog
2023-10-26 14:14:43 -04:00
Jordan Pittman
97e89d76a5
Disable tap highlights on iOS (#12299)
* Disable tap highlights on iOS

* Update changelog

* Update snapshots

* Update changelog
2023-10-26 13:09:38 -04:00
Adam Wathan
662905e5e3
Add subgrid utilities (#12298)
* Add subgrid utilities

* Update CHANGELOG

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-10-26 12:52:39 -04:00
Ahmed Abdelbaset
c92596f549
Fix typo in size-* tests (#12289)
* Update size.test.js

* Fix test

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-10-25 13:54:28 -04:00
Jordan Pittman
e4b32a7a32
Add size-* shorthand (#12287)
* Add `size-*` shorthand

Add plugin tests

Adjust options

wip

* Update changelog
2023-10-25 11:54:37 -04:00
Robin Malfait
761717cb4c
Fix incorrect spaces around - in calc() expression (#12283)
* sync package-lock.json

* prevent formatting inside `env()` when formatting `calc` function

* prevent formatting keywords in `calc`

* add dedicated normalization tests

* `calc()` in `env()` should be formatted

* update changelog
2023-10-25 15:20:49 +02:00
Robin Malfait
89ec6fbe67
Improve automatic var injection (#12236)
* prevent automatic var injection for properties that accept `<dashed-ident>` for the value

* add test

* add `font-palette`

* improve readability
2023-10-24 14:08:46 +02:00
bandogora
41abd500f5
Equal number of grid columns and rows (#12180)
Update test snapshots
2023-10-11 21:00:22 -04:00
Robin Malfait
fa9be73c15
Ensure variants with arbitrary values and a modifier are correctly matched in the RegEx based parser (#12179)
* add failing test

* ensure variants can have modifiers in regex

* update changelog
2023-10-11 16:38:30 +02:00
Jordan Pittman
ad66635c15
Fix sorting of utilities that share multiple candidates (#12173)
* Fix sorting of utilities that share multiple candidates

* Update changelog
2023-10-10 13:50:46 -04:00
Robin Malfait
31a80b1794
Reduce quickPluginTest and quickVariantPluginTest snapshot size (#12170)
* sync package-lock.json

* reduce generated examples

By default we use the default config when creating the quick tests for a
given plugin. However, this can result in _a lot_ of changes. For
example, when you update the opacity values, then these values will be
generated for each color, and for each plugin that uses that color.

You can see that behaviour in Adam's PR (https://github.com/tailwindlabs/tailwindcss/pull/11832).
He added 6 values to the opacity configuration. This resulted in a diff
that looked like this:
```
+219,436 −9
```

This reduces the amount of examples for plugins that generate _a lot_ of
output otherwise.

* use `toMatchSnapshot`

This way all the `quickPluginTest` and `quickVariantPluginTest`
implementations are the same. This also allows us to update tests after
config changes in an easier way because they use snapshot tests right
now.

* use real colors for reduced red

This will make it a tiny bit easier to debug what's going on if we need
it in the future since it's using the same values as the real colors.
2023-10-09 16:49:20 +02:00
Jordan Pittman
09369d27ec Enable error recovery in Lightning CSS 2023-10-03 13:04:17 -04:00
Robin Malfait
82e0acebe0 move failing test to dedicated failing test 2023-10-02 15:12:09 +00:00
Robin Malfait
1879130f45 nit improvement: remove unnecessary spaces 2023-10-02 15:12:09 +00:00
Robin Malfait
9f73b9a33c add missing placeholder-transparent/0 2023-10-02 15:12:09 +00:00
Robin Malfait
a14f6bcf6d update tests to reflect Lightning CSS update
The main things I'm seeing right now are:
1. Some selectors are broken up into multiple selectors, especially when
   there are pseudo classes involved where the output is unknown. For
   example `::ng-deep, ::v-deep {}` will be split into `::ng-deep {},
   ::v-deep {}`
2. It looks like a lot of selectors were dropped, however after looking
   at them in more detail I noticed that they were _duplicated_ before.
   This means that now the output will be smaller in these cases!
2023-10-02 15:12:09 +00:00
Robin Malfait
0af88b1494
Improve RegEx parser, reduce possibilities as the key for arbitrary properties (#12121)
* optimize handling of RegEx parser results

Previous:
- Copy `results`, for every subsequent result of other `patterns`
- Loop over results to filter out `undefined` values
- Loop over results to map to `clipAtBalancedParens`

Current:
- For each candidate, push the `clipAtBalancedParens(candidate)` into
  the `results`

This way we are not copying existing results, and we are also avoiding
additional loops over the entire array to filter out `undefined` values
and map to `clipAtBalancedParens`.

* do not allow `]` in the first part of arbitrary properties

```
[foo:bar]
 ─┬─
  └── This part cannot contain `]`
```

This is also a very targeted fix for when the arbitrary properties seem
to match a large piece of text, but shouldn't

* add real world tests for parsing candidate strings

* sync package-lock.json

* update changelog
2023-10-02 16:19:23 +02:00
Jordan Pittman
5542340a75
Eliminate irrelevant rules when applying variants (#12113)
* Eliminate irrelevant rules when applying variants

* Update changelog
2023-09-29 16:31:43 -04:00
Jordan Pittman
457d2b1b1c
Don’t crash when important and parent selectors are equal in @apply (#12112)
* Don’t crash when important and parent selectors are equal in `@apply`

* Update changelog
2023-09-29 16:04:32 -04:00
Jordan Pittman
1e7dd3a0c4
Skip over classes inside :not(…) when nested in an at-rule (#12105)
* Skip over classes inside `:not(…)` when nested in an at-rule

When defining a utility we skip over classes inside `:not(…)` but we missed doing this when classes were contained within an at-rule. This fixes that.

* Update changelog
2023-09-28 10:45:59 -04:00
Jordan Pittman
05d0a6f8d2
Support loading plugins by package / file name (#12087)
* Cleanup test

Strings are going to actually do something now

* Refactor plugin loading in `resolveConfig`

This should keep the same instance of a plugin in use too. Maybe even reduce memory usage?! idk we’ll see

* Support simple plugin configs

* Update types

* Update changelog
2023-09-26 13:21:42 -04:00
Jordan Pittman
d3f22216c1
Handle variable colors that have variable fallback values (#12049)
* Parse colors even when variable has fallback that is a variable

* Update changelog
2023-09-20 16:34:39 -04:00
Yuhei Yasuda
5366d242c2
Add support for text-wrap: pretty (#12031)
* Add support for `text-wrap: pretty`

* Update changelog

---------

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2023-09-19 08:49:20 -04:00