1723 Commits

Author SHA1 Message Date
Jordan Pittman
2882d4c9ee
Fix ring color utility generation when using respectDefaultRingColorOpacity (#9070)
* Correct ring color list when using `respectDefaultRingColorOpacity`

* Update changelog
2022-08-10 10:36:04 -04:00
Adam Wathan
c7f627dd68
Add support for configuring default font-feature-settings for a font-family (#9039)
* Add support for configuring default font-feature-settings for a font-family

* Update changelog

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2022-08-08 15:02:08 -04:00
流君酱
fbbe3c011e
Use absolute paths when resolving changed files (#9032)
* Fix vite3 postcss statSync not found

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-08-08 10:47:23 -04:00
Jordan Pittman
0a3aad9511 Revert "Don't use cursor: pointer for buttons by default (#8962)"
We’re undecided on whether or not this should be released right now so we’ll revert it and revisit it later.
2022-08-05 10:05:46 -04:00
Jordan Pittman
20456efae4
Fix @apply of user utilities when negative and non-negative versions both exist (#9027)
* Fix application of rules with multiple matches of differing selectors

`-foo-1` and `foo-1` are both matches for the class `-foo-1` but `@apply` only wants the first one. It would remove the second one and cause an error because it’s an entirely separate match that had it’s only rule removed.

* Update changelog
2022-08-04 14:24:17 -04:00
Jordan Pittman
89b960d771
Fix resolution of alpha values inside color functions (#9008)
* Fix resolution of alpha values inside color functions

* Update changelog
2022-08-02 11:13:04 -04:00
Justin Wong
0b5bfc8065
Remove class prefix in arbitrary variant that is used multiple times (#8992)
* Remove prefix in multi-used arbitrary variant

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-07-31 18:20:43 -04:00
Jordan Pittman
262079e1e5 Revert "Revert "Don't use cursor: pointer for buttons by default (#8962)""
This reverts commit e1aafc5df5e33e4fa69e4923ada23e683296dc14.
2022-07-29 17:03:38 -04:00
Jordan Pittman
e1aafc5df5 Revert "Don't use cursor: pointer for buttons by default (#8962)"
This reverts commit ed3a4f3032b486d8d328089011def785d6572462.
2022-07-29 11:03:28 -04:00
Jordan Pittman
a1346c9a8e
Don't rewrite source maps for @layer rules (#8971)
* Cleanup

* Don’t rewrite source maps for `@layer` rules

* Update changelog
2022-07-27 12:19:08 -04:00
Adam Wathan
ed3a4f3032
Don't use cursor: pointer for buttons by default (#8962)
* Don't use `cursor: pointer` for buttons by default

This is a pretty common expectation but as outlined in in #8961 isn't really right. We considered this a long time ago but it felt too against the grain at the time. These days though very UI-forward applications like [Linear](https://linear.app/) are using the default cursor for buttons and I think this trend will continue as more people become aware that `cursor: pointer` is meant for links.

Let's update our defaults here to help nudge people in this direction and make it more common. If people want to change this in their own apps, it's just a line or two of CSS to add to their projects.

* Update changelog

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2022-07-26 20:55:09 -04:00
Jordan Pittman
deefbf5aaf
Handle theme keys with slashes when using theme() in CSS (#8831)
* Fix lookup of `theme(…)` paths with slashes in them

* Update changelog
2022-07-11 10:47:17 -04:00
Tmk
6729524185 Support font-weight in font-size utilities (#8763)
* Support font-weight in font-size utilities

* WIP update tests

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-07-04 17:01:06 -04:00
Jordan Pittman
102977530e
Add support for alpha values in safelist (#8774)
Co-authored-by: Petr Novak <petr.nmn.novak@gmail.com>
2022-07-04 16:37:38 -04:00
Jordan Pittman
8494f7515d
Don’t prefix selectors in arbitrary variants (#8773)
* Don’t prefix selectors in arbitrary variants

* Update changelog
2022-07-04 14:52:24 -04:00
Jordan Pittman
5191ec1c00
Fix usage of special-character prefixes (#8772)
* Fix import

* Support arbitrary prefixes

* Add test

* Update changelog
2022-07-04 14:42:27 -04:00
Jordan Pittman
00af2e8947
Don’t add spaces around raw / that are preceded by numbers (#8688)
* Don’t add spaces around raw `/` that are preceded by numbers

* Update changelog
2022-06-20 10:49:55 -04:00
Jordan Pittman
c5e7857362
Detect arbitrary variants with quotes (#8687)
* Refactor

* Support variants with quotes in them

We have to have two regexes here because this is actually ambiguous in the general case. The regex that generally handles `[&[foo='bar']]` would incorrectly match `['bar':'baz']` for instance. So, instead we’ll use multiple regexes and match both!

* Update changelog
2022-06-20 09:56:40 -04:00
Jordan Pittman
9778b528dc
Provide default to <alpha-value> when using theme() (#8652)
* Ensure default alpha is 1.0 when using new `<alpha-value>` format with the theme function

* Update changelog
2022-06-15 15:11:08 -04:00
Jordan Pittman
15dc5a3da9
Remove text opacity CSS variables from ::marker (#8622)
* Refactor

* Allow parallel variant fns to mutate the container

* Remove text color variable from marker pseudo class

wip

* Update changelog
2022-06-14 10:09:09 -04:00
Adam Wathan
22eaad17c3
Fix "Maximum call stack size exceeded" bug (#8636)
* Fix potential call stack size issue

* Update defaultExtractor.js

* add test to verify "Maximum call stack size exceeded" is fixed

* update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-06-14 14:17:40 +02:00
Jordan Pittman
1c24d7a473
Detect alpha value in CSS theme() function when using quotes (#8625)
* Allow alpha value inside quotes

* Optimize regex

* Add test

* Update changelog
2022-06-13 15:32:52 -04:00
Dany Castillo
aad299cf90
Fix missing spaces around arithmetic operators (#8615)
* add tests for spaced around operators in CSS math functions

* fix CSS math functons besides calc not getting the love they deserve

* improve comment

* update changelog

* update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-06-13 11:58:07 +02:00
Jordan Pittman
037396b4a6
Ignore PostCSS nodes returned by addVariant (#8608)
* Fix issue with returning postcss nodes in addVariant

It’s not a supported use case but it didn’t use to break so let’s just fail silently

* Update changelog
2022-06-12 10:50:41 -04:00
Jordan Pittman
a9c7e52a59
Fix extraction of multi-word utilities with arbitrary values and quotes (#8604)
* Fix extraction of multi-word utilityies with arbitrary values and quotes

* Update  changelog

* Fix changelog entry

This wasn’t in 3.1.2 oops
2022-06-12 10:10:10 -04:00
Robin Malfait
0d064ea032
Enable postcss-import in the CLI by default in watch mode (#8580)
* Add support for postcss-import in watch mode

* Add regression test

* Extract shared logic

* restructure test a little bit

Instead of relying on a arbitrary setTimout value, let's wait for the
file to be created instead.

* update changelog

Co-authored-by: Adam Bergman <adam@fransvilhelm.com>
2022-06-10 11:33:35 +02:00
Robin Malfait
d32728b433
Ensure \ is a valid arbitrary variant token (#8576)
* `\` are valid arbitrary variant tokens

We use `\` for escaping `.` or `_` so they should be part of the
arbitrary variant regex.

* update changelog
2022-06-10 10:51:16 +02:00
Jordan Pittman
0664aae901
Fix class detection in markdown code fences and slim templates (#8569)
* Fix detection of classes in markdown code fences

* Fix candidate detection in `.slim` templates

* Update changelog
2022-06-09 16:53:02 -04:00
Jordan Pittman
6b1eb19079
Split ::backdrop into separate defaults group (#8567)
* Split `::backdrop` into separate defaults group

* Update tests

* Update changelog
2022-06-09 16:26:18 -04:00
Jordan Pittman
7aa2d4ddf3
Don’t clip slashes inside brackets when using the theme function (#8563) 2022-06-09 14:09:57 -04:00
Robin Malfait
9a5db88e54
Fix candidate extractor regression (#8558)
* fix regression

This is a regression where `%>utility<%` didn't properly abstract
`utility`

* update changelog
2022-06-09 18:22:20 +02:00
Robin Malfait
a0c2ee8c38
Ensure we can use @import 'tailwindcss/...' without node_modules (#8537)
* ensure we can use `@import 'tailwindcss/...'` without node_modules

This is useful if you are using `npx tailwindcs ...` and to prevent
that postcss-import crashes on the tailwind specific imports which we
will replace anyway.

* update changelog
2022-06-07 19:03:38 +02:00
Ivo Sabev
ac91c6aaae
Remove process dependency from log functions (#8530)
* Remove process dependency from log functions

* Fix check

* update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-06-07 11:23:32 +02:00
Adam Wathan
4f400767a8
Add ::backdrop to universal defaults (#8526)
* Add `::backdrop` to universal defaults

* Update changelog
2022-06-06 15:53:08 -04:00
Jordan Pittman
14f6574318
Only listen for stdin close on TTYs (#8523) 2022-06-06 10:04:18 -04:00
Robin Malfait
4a745439f0
Add type annotations to the tailwind.config.js file (#8493)
* add type annotation to the config by default

* use `@type {import('tailwindcss').Config}` instead
2022-06-02 16:44:12 +02:00
Jordan Pittman
64b4e6df7b
Replace rgb and hsl helpers with <alpha-value> placeholder for colors with custom properties (#8501)
* implement <alpha-value>

* remove `rgb`/`hsl` helpers, use `<alpha-value>` instead

* never pass undefined to `withAlphaValue`

* WIP

* WIP

* WIP

* WIP

* Update changelog

* Cleanup

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-06-02 10:21:20 -04:00
Adam Wathan
c65a1a2a79
Don't inherit gradient "to" from parent (#8489)
* Don't inherit gradient "to" from parent

* Update changelog
2022-06-01 15:25:45 -04:00
Adam Wathan
fca70850b2
Add optional variant (#8486)
* Add  variant

* Update changelog
2022-06-01 08:39:43 -04:00
Adam Wathan
a11e0c63be Disable variantGrouping experiment 2022-06-01 06:02:15 -04:00
Jordan Pittman
34fd0fb82a Feature flag matchVariant API 2022-05-31 13:15:14 -04:00
Robin Malfait
d2fdf9eb09
Allow returning parallel variants from addVariant or matchVariant callback functions (#8455)
* allow to return an array of format strings from matchVariant or
addVariant

* add parallel variant with function test

* upgrade test to use a function call

* allow to return parallel variants from variant function

Caveat: this now belongs to the same plugin and is not registered as
separate variants which means that sort order can differ.

* prevent crash if `.toMatchFormattedCss()` receives undefined

* update changelog

* ensure that we use a local list of variant functions

Now that a variant function can return a list of variant functions from
within the plugin, we have to make sure to executed and register those
functions as well.

However, we need to make sure that this list is local for the variant
and not "globally" registered otherwise we keep add a dynamic function
to the global list which results in duplicate output becaus multiple
duplicate variants will be registered.

* add little warning regarding potential clashes

* Update CHANGELOG.md
2022-05-31 15:03:06 +02:00
Jordan Pittman
3f4005e833 Disable filterDefault for ring opacity when using respectDefaultRingColorOpacity 2022-05-27 09:59:52 -04:00
Jordan Pittman
cab1fcecc5
Add future flag to preserve custom, default ring color opacity (#8448)
* Add future flag to preserve ring color opacity

* Update changelog
2022-05-27 09:48:27 -04:00
Jordan Pittman
c4e443acc0
Add postcss-import support to the CLI (#8437)
* Add postcss-import support to the CLI

* Update changelog
2022-05-25 14:28:52 -04:00
Jordan Pittman
50bed74cdc
Support alpha values for theme() function (#8416)
* Fix typo

* Support alpha modifier for theme color values

* Eliminate redundant object creation in resolveFunctionKeys

Building an object of N keys incrementally using Object.reduce + splat results in N intermediate objects. We should just create one object and assign each key.

* Switch to inline theme values in theme fn in config

* Add test case

And fix typos that were definitely not there

* Update changelog
2022-05-25 13:54:30 -04:00
Jordan Pittman
50024e4603 Fix grouping using different variant types inside nested groups 2022-05-23 15:43:12 -04:00
Jordan Pittman
b0e1f47b94 Be more direct about variant group extractions
Also adds a previously failing but now passing test case
2022-05-23 15:29:29 -04:00
Robin Malfait
68ff4ba500
Experimental support for variant grouping (#8405)
* WIP

* use correct separator

* run all tests

* Fix regex

* add a few more tests

* name the experimental feature flag `variantGrouping`

* update changelog

* rename test file `variant-grouping`

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-05-23 17:45:23 +02:00
Robin Malfait
816a0f26c9
Add prefers-contrast media query variants (#8410)
* Add prefers-contrast variants

* add tests for prefers contrast

* dark mode should have precedence over prefers contrast variants

* update changelog

Co-authored-by: Luke Warlow <projects@warlow.dev>
2022-05-23 17:40:14 +02:00