Commit graph

1962 commits

Author SHA1 Message Date
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
a94a21257a Tweak warning messages 2024-01-05 12:17:01 -05:00
Jordan Pittman
1544ef576d Add dark mode variant option 2024-01-05 12:17:01 -05:00
Robin Malfait
a5ae318a14
Improve glob handling for folders with (, ), [ or ] in the file path (#12715)
* sync package-lock.json

* modify `normalizePath` to keep `\\[`, `\\]`, `\\(` and `\\)` into account

* manually escape () and [] characters in globs

* update changelog
2024-01-05 17:23:30 +01: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
Jordan Pittman
d884e9bc84
Fix custom config loading in Standalone CLI (#12616)
* Fix custom config loading in Standalone CLI

* Update changelog
2023-12-18 13:50:21 -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
d2bb6f1bd0 Fix candidate detection regex 2023-12-04 11:24:03 -05:00
Jordan Pittman
6dfcdd1007
Fix loading of built-in plugins when using an ESM or TypeScript config with the Standalone CLI (#12506) 2023-12-01 11:44:30 -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
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
cf97c2274a
Don’t output @config in CSS file after a rebuild (#12327) 2023-10-30 14:37:49 -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
8f788e27b0 Tweak comment 2023-10-30 09:09:00 -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
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
Marco Carvalho
bcfb38d5f9
Refactor length function to utilize a pre-compiled RegExp (#12251)
* Refactor length function to utilize a pre-compiled RegExp

* Update dataTypes.js
2023-10-20 13:50:42 +02:00
2hu
a1bcfa2479
Allow plugins from a parent document to be used in an iframe (#12208)
* Fix cross iframe isPlainObject check

* Update changelog

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-10-17 10:41:53 -04:00
Jordan Pittman
0b0862b20c
Fix crash when watching renamed files on FreeBSD (#12193)
* Fix file watching bug when renaming files on FreeBSD

* Update changelog

* Add delay to test

* Bump delay

* Update test
2023-10-17 09:50:35 -04:00
Simon He
e9ca7ab453
Speed up CSS math function check (#12215)
* perf(cssMathFnRE): Dynamically create regular rules

* Cleanup code

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-10-16 20:18:17 -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
51ac627491 Fix spelling 2023-10-10 16:17:08 -04: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
Jordan Pittman
09369d27ec Enable error recovery in Lightning CSS 2023-10-03 13:04:17 -04:00
Robin Malfait
91fb37cbe3 adjust Lightning CSS API 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
aaca7c4c4c
Batch reading content files to prevent too many open files error (#12079)
* Refactor

* Refactor

* Batch content file reads in Node into groups of 500

We shouldn’t need to do this for our Rust code because it utilizes Rayon’s default thread pool for parallelism. This threadpool has roughly the number of cores as the number of available threads except when overridden. This generally is much, much lower than 500 and can be explicitly overridden via an env var to work around potential issues with open file descriptors if anyone ever runs into that.

* Fix sequential/parallel flip

* Update changelog
2023-09-25 12:18:11 -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
Brandon McConnell
9faf10958b
Update Preflight html styles to include shadow DOM :host pseudo-class (#11200)
* Extend current preflight `html` styles to support other root/host scopes

Supports SVG root scope, ShadowDOM, and presumably other root scopes

* Replace `:root` with `html`

* Update tests

* Update changelog

---------

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2023-09-08 11:46:57 -04:00
Jordan Pittman
0198e84c90 Remove unused imports 2023-08-23 09:42:07 -04:00
Jordan Pittman
9a52f90fe9 Remove grouping prototype
This code has been sitting around for a while disabled and untested. And it does not work with the Oxide parser. So we’re gonna remove it.
2023-08-21 11:01:19 -04:00