52 Commits

Author SHA1 Message Date
Jordan Pittman
3011f46cd8 Enable generalizedModifiers flag by default 2022-10-13 14:13:02 -04:00
Jordan Pittman
45d1a1b593
Add generalized modifier support to matchUtilities (#9541)
* Change `matchVariant` API to use positional arguments

* Fix CS

wip

* Change match variant wrap modifier in an object

Needed for compat w/ some group and peer plugins

* Add modifier support to matchUtilities

* refactor

* Hoist utility modifier splitting

* Rename fn

* refactor

* Add support for generic utility modifiers

* Fix CS

* wip

* update types

* Warn when using modifiers without the option

* Allow modifiers to be a config object

* Make sure we can return null from matchUtilities to omit rules

* Feature flag generalized modifiers

We’re putting a flag for modifiers in front of matchVariant and matchUtilities

* cleanup

* Update changelog

* Properly flag variants using modifiers

* Fix test
2022-10-13 14:01:17 -04:00
Robin Malfait
5788a9753a
Add experimental labels for variants (#9456)
* add ability to add a `label`

This could be used for named groups or named container queries in the
future.

* expose `container` to `matchVariant`

Ideally we don't have to do this. But since we will be implementing
`group` and `peer` using the `matchVariant` API, we do require it for
the `visited` state.

* implement `group` and `peer` using the `matchVariant` API

* remove feature flag for `matchVariant`

* update changelog
2022-10-06 13:53:51 -04:00
Jordan Pittman
bf44941049
Allow resolving content paths relative to the config file (#9396)
* Update lockfile

* Tweak formatting

* Refactor content path parsing

* Allow resolving content paths relative to the config file

* Include resolved symlinks as additional content paths

* Update changelog

* Work on suite of tests for content resolution

* reformat integration test list

* Move content resolution tests to integration

* Update future and experimental types
2022-09-23 08:09:02 -04:00
Jordan Pittman
b0018e20bf
Add future flag to disable color opacity utility plugins (#9088)
* Add future flag to disable opacity utility plugins

This will become the default in Tailwind CSS v4.0

* Update changelog
2022-08-15 13:45:02 -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
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
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
Adam Wathan
128030fcfa
Only apply hover styles when supported (future) (#8394)
* Only apply hover styles when supported (future)

Co-Authored-By: Andrew Brown <browner12@gmail.com>

* update changelog

Co-authored-by: Andrew Brown <browner12@gmail.com>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-05-20 11:20:20 -04:00
Bogdan Chadkin
2dec5649c9
Replace chalk with picocolors (#6039)
* Replace chalk with picocolors

Already used in latest postcss, autoprefixer and browserslist versions.

See https://github.com/alexeyraspopov/picocolors

* Update `dim` function

Co-authored-by: Brad Cornes <bradlc41@gmail.com>
2022-02-24 16:37:31 +00:00
Jordan Pittman
f2d73b8c3d
Change how we handle defaults (optimized or not) (#6926)
Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2022-01-07 11:39:45 -05:00
Robin Malfait
860c61cd61
temporarily disable optimize universal defaults (#6461)
* temporarily disable optimize universal defaults

* update changelog
2021-12-13 15:39:18 +01: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
Jonathan Reinink
b8cda161dd
Improve warnings (#5666) 2021-10-01 11:47:02 -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
Robin Malfait
a34bd62bb6
Remove lodash (#5390)
* remove `lodash` usage

* implement custom cloneDeep to replace lodash's

* drop lodash in processPlugins

* add `toPath` utility

* add `tap` utility

* add `cloneDeep` utility

* drop lodash in evaluateTailwindFunctions

* add `defaults` utility

* drop lodash from `resolveConfig`

* remove `lodash` dependency
2021-09-06 14:15:10 -04:00
Adam Wathan
a9e160cf9a Reintroduce universal selector optimization behind experimental flag 2021-09-06 13:58:02 -04:00
Adam Wathan
b6598e9898 Remove additionalBreakpoint from flags 2020-10-19 16:47:10 -04:00
Adam Wathan
322d366440 Extend font size scale 2020-10-18 15:43:50 -04:00
Adam Wathan
dc9d510c8a Extend spacing scale
By probably too much.
2020-10-18 15:43:50 -04:00
Adam Wathan
9a8c170223 Remove uniformColorPalette experiment 2020-10-18 15:43:50 -04:00
Adam Wathan
7376d7c8b1 Enable dark mode 2020-10-18 15:43:50 -04:00
Adam Wathan
782a828c81 Switch to new apply implementation 2020-10-18 15:43:50 -04:00
Adam Wathan
998f3ffc03 Move truncate to textOverflow plugin 2020-10-18 15:43:50 -04:00
Adam Wathan
1371e7951e Use standard font weight names by default 2020-10-18 15:43:50 -04:00
Adam Wathan
7d102598f9 Add line-heights to font-size utilities by default 2020-10-18 15:43:50 -04:00
Adam Wathan
b008d0c08a Remove 'conservative' purge mode 2020-10-18 15:43:50 -04:00
Adam Wathan
4959a99f77 Remove deprecated gap utilities 2020-10-18 15:43:50 -04:00
Adam Wathan
38b4eeb288 Prettier likes parens a lot now
git blame is now broken forever.
2020-10-16 15:39:44 -04:00
Adam Wathan
6927155956 Don't warn about future flags 2020-10-16 14:53:27 -04:00
Adam Wathan
ae8b634f33
Move truncate to textOverflow (#2562)
* Move truncate to textOverflow

* Update changelog
2020-10-14 16:54:13 -04:00
Adam Wathan
1067ccee10 Promote defaultLineHeights and standardFontWeights from experimental to future 2020-10-07 14:12:42 -04:00
Adam Wathan
d01636caff Add experimental 2xl breakpoint (#2468) 2020-10-07 14:12:42 -04:00
Adam Wathan
cfd86836c5 Make standardFontWeights experimental until v1.9, update changelog 2020-09-06 20:43:36 -04:00
Adam Wathan
30a4e513ef
Rename hairline and thin font weights to thin and extralight (#2333)
* Add standardFontWeights flag for update thin/extralight font weight names

* Update changelog
2020-09-06 07:06:58 -04:00
Adam Wathan
d44e75fc79
Purge layers by default, deprecate conservative mode (#2288)
* Purge `layers` by default, deprecate `conservative` mode

* Ensure base styles are wrapped in @layer

* Update processPlugins test
2020-09-02 14:42:27 -04:00
Adam Wathan
5701d7847b
Add dark mode variant (#2279)
* Initial dark mode prototype

* Isolate dark mode logic to config extension

* Update fixtures

* Fix lint warnings
2020-09-01 13:16:00 -04:00
Adam Wathan
b17b51811f Remove unused function 2020-08-19 13:34:21 -04:00
Adam Wathan
b3db1053b5 Don't log anything for people who have opted in to future features 2020-08-19 13:28:04 -04:00
Adam Wathan
2d090feb98 Only log purge notice once per process 2020-08-19 10:56:51 -04:00
Adam Wathan
ef149cfafb Optimize rebuilds in long-running processes 2020-08-19 10:21:26 -04:00
Adam Wathan
092009b508 Simplify flag logging 2020-08-18 13:23:08 -04:00
Adam Wathan
cef0b84abf Reorganize prototype code 2020-08-14 12:23:28 -04:00
Adam Wathan
36fc03b16d Add initial support for applying variants and other complex classes 2020-08-12 19:47:21 -04:00
Adam Wathan
aa810673f4 Add experimental extendedFontSizeScale 2020-08-07 15:10:10 -04:00
Adam Wathan
4d2e4119fd Add experimental default line heights 2020-08-07 14:42:43 -04:00
Adam Wathan
30980063e8 Add experimental extended spacing scale 2020-08-07 11:25:22 -04:00
Adam Wathan
feb43849c4 Link to upcoming changes documentation in flag notices 2020-08-07 11:09:53 -04:00
Adam Wathan
338dc12eea Deprecate col-gap and row-gap in favor of gap-x and gap-y 2020-08-06 16:27:35 -04:00