5104 Commits

Author SHA1 Message Date
Jonathan Reinink
fb796cd2ec
Extend default color palette with new 950 shades (#10879)
* Add 950 colors

* Update changelog
2023-03-27 14:47:13 -04:00
Robin Malfait
55aa4035f5
Fix format assumption when resolving module dependencies (#10878)
* fix assumption when resolving dependencies

When resolving dependencies given a path, we are only interested
relative files from the current file. We are not interested in the
dependencies that are listed in your `package.json` and thus in your
`node_modules` folder.

We made the assumption that your imports have at least 3 characters.
This sort of makes sense because there will be a `.`, then the OS
separator like `/` and than a file name. E.g.: `./a` is the minimal
amount of characters.

This makes sense for `import` statements, but in the case of `require`,
it is totally valid to write `require('.')`. This will require the
current `index.{js,ts,mjs,cjs,...}` in the current directory.

Before this change, having a `require('.')` wouldn't crash, but the
dependency would not be marked as a module dependencies and therefore we
won't listen for file changes for that dependency.

* update changelog
2023-03-27 19:41:20 +02:00
Robin Malfait
8e85a865da
Ensure module dependencies for value null, is an empty Set (#10877)
* ensure we have no dependencies when `absoluteFilePath` is `null`

This happens in the CLI where we don't have a guaranteed `path` for the
config file. This can happen in practice if you use:

```console
npx tailwindcss --content ./index.html -o ./output.css
```

... and if you don't have a `tailwind.config.{js,ts,cjs,...}` in the
current directory.

* update changelog
2023-03-27 19:09:06 +02:00
Robin Malfait
5b77b42574
Reset all properties when using line-clamp-none (#10876)
* reset other properties on `line-clamp-none`

* update CHANGELOG
2023-03-27 18:56:14 +02:00
depfu[bot]
71035b7bbe Update vite to version 4.2.1 2023-03-27 14:59:41 +00:00
Robin Malfait
b2f132ec33
prepare for v3.3 release 2023-03-27 16:23:24 +02:00
Robin Malfait
c26e77cb6f
sync package-lock.json 2023-03-27 12:32:16 +02:00
Jonathan Reinink
3c4cfb5272
Update changelog 2023-03-24 11:32:12 -04:00
Brandon McConnell
47b8289aba
Add support for white-space: break-spaces (#10729) 2023-03-24 11:30:37 -04:00
Jordan Pittman
6ed3ba365d Update warning message 2023-03-24 10:44:18 -04:00
Jordan Pittman
6138d69c1b
Warn when @tailwindcss/line-clamp plugin is being used (#10862)
* Warn if line-clamp plugin is installed

* Replace line-clamp in standalone CLI

* Update import

* Remove line-clamp plugin if found

* update lockfiles

* Update changelog
2023-03-24 09:58:06 -04:00
depfu[bot]
4b44daf3b5 Update esbuild to version 0.17.12 2023-03-24 07:45:03 +00:00
Jordan Pittman
1d505e9c8c Revert "Remove blocklisted classes from autocomplete (#10844)"
This reverts commit f1473f53bb9e90b02f319cb1c88093406f10c990.
2023-03-23 15:18:49 -04:00
Jordan Pittman
f1473f53bb
Remove blocklisted classes from autocomplete (#10844)
* Remove blocklisted classes from autocomplete

* Update changelog

* Don't unnecessary loop over classes

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-03-23 15:03:56 -04:00
depfu[bot]
eadd6e5de9 Update sass to version 1.59.3 2023-03-21 22:45:06 +00:00
Adam Wathan
266f0292ba
Use :is to make important selector option insensitive to DOM order (#10835)
* Use `:is` to make important selector option insensitive to DOM order

* WIP

* add `applyImportantSelector` helper

* use new `applyImportantSelector`

* update tests

* remove unnecessary slice adjustment

Not 100% sure.

* update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-03-21 17:50:44 +01:00
Robin Malfait
e4482c7596
ensure stacking dark and rtl variants with pseudo elements works as expected 2023-03-21 15:32:16 +01:00
depfu[bot]
4d2d870add Update rollup to version 3.20.0 2023-03-21 09:49:20 +00:00
Adam Wathan
bac5ecf004
Add list-style-image support (#10817)
* add `listStyle` instead of `listStyleType`

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>

* add `listStyleType` related deprecation warnings

* Implement list-style-image as separate plugin

* Remove unused code, update tests

* Always generate `list-none`, don't pull it from theme

* Gracefully handle missing listStyleType configuration

* Just use `list-image-*` fuck it

* Update changelog

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Peter Neupauer <peter@neupauer.sk>
2023-03-20 14:40:35 -04:00
Adam Wathan
69d29c9218 Update changelog 2023-03-20 14:34:31 -04:00
Robin Malfait
439fdadb3a
ensure we look at the extension from the "parent" file
If you have a file `./a.js`, and you import `./b`, then `./b` should be
resolved based on the `./a.js` extension and use the
`jsResolutionOrder`.
2023-03-20 19:02:52 +01:00
Robin Malfait
e046a37dbc
Improve bundle size by replacing detective-typescript (#10825)
* replace `detective-typescript` with our own implementation

We are not parsing the code but just trying to pluck out the
dependencies used via `import` and `require`.

* drop `detective-typescript`

* return a `Set` instead of an `Array`

* resolve rebuilds, but log errors in case they occur

This won't be the prettiest if it happens, but at least we are not
swallowing errors which should make bugs be easier to discover.

See previous commit for an example... 😅

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-03-20 18:30:47 +01:00
depfu[bot]
6a2c58acf8 Update @swc/core to version 1.3.41 2023-03-20 06:31:33 +00:00
Robin Malfait
acf9403826
transform files using @swc/jest (#10815) 2023-03-17 16:22:16 +01:00
Robin Malfait
8132de6660
refactor log.warn checks in tests 2023-03-17 14:49:36 +01:00
Robin Malfait
ab66c5afe3
add toHaveBeenWarned and toHaveBeenWarnedWith custom matchers 2023-03-17 14:46:44 +01:00
depfu[bot]
2de0aa9d91 Update autoprefixer to version 10.4.14 2023-03-16 22:19:27 +00:00
Robin Malfait
ac1738e748
fix stubs glob in files of package.json 2023-03-15 22:31:12 +01:00
Robin Malfait
27cb947784
delete unused stub 2023-03-15 22:30:42 +01:00
Robin Malfait
7e9a53f6cb
Enable ESM and TS based config files (#10785)
* add `jiti` and `detective-typescript` dependencies

* use `jiti` and `detective-typescript`

Instead of `detective`, this way we will be able to support
`tailwind.config.ts` files and `ESM` files.

* use `@swc/core` instead of the built-in `babel` form `jiti`

* update changelog

* add `jiti` and `detective-typescript` dependencies to `stable`

* use `sucrase` to transform the configs

* add `sucrase` dependency to `stable` engine

* make loading the config easier

* use abstracted loading config utils

* WIP: make `load` related files public API

* use new config loader in PostCSS plugin

* add list of default config files to look for

* cleanup unused arguments

* find default config path when using CLI

* improve `init` command

* make eslint happy

* keep all files in `stubs` folder

* add `tailwind.config.js` stub file

* Initialize PostCSS config using the same format as Tailwind config

* Rename config content stubs to config.*.js

* Improve option descriptions for init options

* Remove unused code, remove `constants` file

* Fix TS warning

* apply CLI changes to the Oxide version

* update `--help` output in CLI tests

* WIP: make tests work on CI

TODO: Test all combinations of `--full`, `--ts`, `--postcss`, and `--esm`.

* wip

* remove unused `fs`

* Fix init tests

Did you know you could pass an empty args to a command? No? Me neither. ¯\_(ツ)_/¯

* bump `napi-derive`

* list extensions we are interested in

* no-op the `removeFile` if file doesn't exist

* ensure all `init` flags work

* ensure we cleanup the new files

* test ESM/CJS generation based on package.json

* remove unnecessary test

We are not displaying output in the `--help` anymore based on whether
`type: module` is present or not.
Therefore this test is unneeded.

* only look for `TypeScript` files when the entryFile is `TypeScript` as well

* refactor `load` to be `loadConfig`

This will allow you to use:

```js
import loadConfig from 'tailwindcss/loadConfig'

let config = loadConfig("/Users/xyz/projects/my-app/tailwind.config.ts")
```

The `loadConfig` function will return the configuration object based on
the given absolute path of a tailwind configuration file.

The given path can be a CJS, an ESM or a TS file.

* use the `config.full.js` stub instead of the `defaultConfig.stub.js` file

The root `defaultConfig` is still there for backwards compatibilty
reasons. But the `module.exports = requrie('./config.full.js')` was
causing some problems when actually using tailwindcss.

So dropped it instead.

* apply `load` -> `loadConfig` changes to `Oxide` engine CLI

* ensure we write the config file in the Oxide engine

* improve type in Oxide engine CLI

* catch errors instead of checking if the file exists

A little smaller but just for tests so doesn't matter too much here 👍

* ensure we publish the correct stub files

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Nate Moore <nate@natemoo.re>
Co-authored-by: Enzo Innocenzi <enzo@innocenzi.dev>
2023-03-15 17:04:18 -04:00
Jordan Pittman
694aea0e2c Update lockfile 2023-03-15 18:02:13 +00:00
depfu[bot]
c0da7bb0c5 Update rimraf to version 4.4.0 2023-03-15 18:02:13 +00:00
depfu[bot]
66fd0c9983 Update all of jest to version 29.5.0 2023-03-15 13:03:01 +00:00
depfu[bot]
c33c5234ef Update eslint-config-prettier to version 8.7.0 2023-03-13 11:23:35 +00:00
Robin Malfait
7b4385cdfd
fix typo 2023-03-10 22:44:25 +01:00
depfu[bot]
990398f52c Update eslint to version 8.35.0 2023-03-10 20:51:07 +00:00
Robin Malfait
7eab762a3d
Add line-clamp utilities from @tailwindcss/line-clamp to core (#10768)
* add `lineClamp` utility

This is coming from the `@tailwindcss/line-clamp` package that we now
merged into the core of Tailwind itself.

* update changelog
2023-03-10 18:47:43 +01:00
Adam Wathan
e40b73a127
Make dark and rtl/ltr variants insensitive to DOM order (#10766)
* Make `dark` and `rtl`/`ltr` variants insensitive to DOM order

* Add explicit test for stacking dark and rtl variants

* Update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-03-10 12:03:38 -05:00
Robin Malfait
ba56e426af
Use inset instead of top, right, bottom, and left properties (#10765)
* use `inset` instead of `top`, `right`, `bottom` and `left` properties

* update changelog
2023-03-10 16:52:08 +01:00
Adam Wathan
c7d605f8c5
Remove warnings when using RTL/LTR variants (#10764)
* Remove warnings when using RTL/LTR variants

* Update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-03-10 10:35:41 -05:00
depfu[bot]
5e9470c5cb Update lilconfig to version 2.1.0 2023-03-09 20:49:16 +00:00
depfu[bot]
5bb351ea75 Update @napi-rs/cli to version 2.14.8 2023-03-08 10:07:12 +00:00
depfu[bot]
a64ce192cc Update turbo to version 1.8.3 2023-03-08 00:32:06 +00:00
depfu[bot]
994b541779 Update vite to version 4.1.4 2023-03-03 02:44:15 +00:00
depfu[bot]
bfdf3a7d1f Update @swc/cli to version 0.1.62 2023-03-02 21:47:26 +00:00
Jonathan Reinink
d91344c148
Update changelog 2023-03-01 09:04:46 -05:00
Dany Castillo
e366985a82
Add content-normal and content-stretch utilities (#10645)
* Add content-stretch utility

* Add `content-normal` utility

---------

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2023-03-01 09:03:50 -05:00
depfu[bot]
52ca21bcea Update sass to version 1.58.3 2023-03-01 02:16:15 +00:00
Robin Malfait
1874798bdd
Ensure CLI builds have a non-zero exit code on failure (#10703)
* ensure simple builds have a non-zero exit code on failure

This is not used for the watcher.

* update changelog
2023-02-28 16:50:06 +01:00
depfu[bot]
0c9b3f9333 Update esbuild to version 0.17.10 2023-02-27 06:33:57 +00:00