Commit graph

5286 commits

Author SHA1 Message Date
Robin Malfait
316190fe5a
start incremental rebuild work on PostCss 2024-03-08 18:36:42 +01:00
Robin Malfait
ac3f03a07e
rename tailwindcss-v4 to @tailwindcss/postcss 2024-03-08 18:36:42 +01:00
Robin Malfait
a45ae05fca
improve checking if new candidates were added or not 2024-03-08 18:36:42 +01:00
Robin Malfait
145df6ca53
encapsulate invalidRawCandidates 2024-03-08 18:36:42 +01:00
Robin Malfait
d7ec348412
rename parseAstNode to compileAstNodes 2024-03-08 18:36:42 +01:00
Robin Malfait
e05e5ece43
expose methods instead of raw DefaultMaps 2024-03-08 18:36:42 +01:00
Robin Malfait
ce38fcde3e
only optimize using Lightning CSS if the compiled css actually changed 2024-03-08 18:36:42 +01:00
Robin Malfait
a0f23d3306
do not clear the Rust cache
The candidates from the content files are still going to be correct as
long as the file didn't change.
2024-03-08 18:36:41 +01:00
Robin Malfait
115417fed4
move cached parsers to designSystem 2024-03-08 18:36:41 +01:00
Robin Malfait
d04a17c102
drop unnecessary comment 2024-03-08 18:36:41 +01:00
Robin Malfait
a19bc73e70
build allValidCandidates from all rawCandidates that are not invalid 2024-03-08 18:36:41 +01:00
Robin Malfait
50da0a1be2
allow any iterable string as input
This way we can pass it an array or a set without first converting it.
2024-03-08 18:36:41 +01:00
Robin Malfait
02b1794684
drop todo
This only takes ~0.4ms in the tailwindcss.com repo
2024-03-08 18:36:41 +01:00
Robin Malfait
48b56017cd
hoist invalidRawCandidates
This way the cache can start filling up before a rebuild happens
2024-03-08 18:36:41 +01:00
Robin Malfait
c65598e12c
cache compiledCss 2024-03-08 18:36:41 +01:00
Robin Malfait
62ee42c30c
ensure input file is an import dependency 2024-03-08 18:36:41 +01:00
Robin Malfait
27e06c76d2
cache all the things 2024-03-08 18:36:41 +01:00
Robin Malfait
6282e2b22e
ensure we don't crash on deleted files 2024-03-08 18:36:41 +01:00
Robin Malfait
1b3ad0db65
WIP 2024-03-08 18:36:40 +01:00
Robin Malfait
b0353871f7
update tests to reflect order change 2024-03-08 18:36:40 +01:00
Robin Malfait
43eecb981a
remove localeCompare calls 2024-03-08 18:36:40 +01:00
Robin Malfait
1e0b35d836
move sorting logic to the end 2024-03-08 18:36:40 +01:00
Robin Malfait
d6e5858e56
return rebuild function from compile 2024-03-08 18:36:40 +01:00
Robin Malfait
c550a62be4
[v4] Make CSS optimization and minification configurable (#13130)
* only run Lightning CSS when passing `--minify` to the CLI

* only optimize the CSS when creating a production build

* add `optimize` option to PostCSS plugin

- The optimize option can be set to `true`, which will optimize
  (unnesting, adding browser prefixes, lowering values) and minify
- The optimize option can also be set to `{ minify: false }`, which will
  optimize but not minify.

* default `optimize` option to the true for `NODE_ENV=production`

* add `--optimize` flag to CLI

This will only optimize the CSS output without minification.

* update `--minify` description

* update changelog
2024-03-08 18:36:07 +01:00
Kris Braun
7132875d02
[v4] Add font-stretch utilities (#13153)
* [v4] Add `font-stretch` utilities

Based on #12171 y @Gregory-Gerard.

Add [`font-stretch`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-stretch) utilities. Naming with `font-stretch` rather than `stretch` since the latter isn't clearly associated with fonts. Named values (e.g. `font-stretch-ulta-expanded`) and percentages (e.g. `font-stretch-50`) are supported.
2024-03-08 12:10:29 -05:00
Can Kolay
0e1af11b30
[v4] Android binaries for Oxide (#13115) 2024-03-08 12:08:24 -05:00
Adam Wathan
0a57d33a7d
Don't error on @apply with extra whitespace (#13144)
* Don't crash on @apply with extra whitespace

* Update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-03-07 22:00:15 -05:00
Kris Braun
eca02424f5
v4 changelog (#13131)
---------

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2024-03-07 14:26:35 -05:00
Robin Malfait
d288c52780
bump versions to 4.0.0-alpha.6 2024-03-07 16:00:23 +01:00
Robin Malfait
324273ce8d
[v4] Only allow CSS variables in @theme (#13125)
* add `WalkAction` to indicate how the `walk` function should behave

You can `Continue` its execution (the default behaviour), `Skip` walking
the current node, or `Stop` walking entirely.

* walk the nodes of `@theme` directly

There is no need to walk the `@theme` itself or to create a temporary
array here.

* improvement: skip walking

* only allow CSS variables inside `@theme`

* update error message
2024-03-07 15:59:59 +01:00
Adam Wathan
d27f4cee32
Update CONTRIBUTING.md 2024-03-07 09:34:19 -05:00
Adam Wathan
fcaff7c613
[v4] Only set border-style for appropriate border side (#13124)
* Only set border-style for appropriate border side

Fixes #13121.

Something to consider is that this implementation will still have issues if we ever implement support for utilities like `border-r-dashed`. 6am and I just woke up and am going to the gym now but leaving this as a note to consider when I get back before merging :)

* Fix typos in test names

* Revert playground change

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-03-07 09:11:28 -05:00
Robin Malfait
9864b9c9cd
bump versions to 4.0.0-alpha.5 2024-03-07 00:40:10 +01:00
Robin Malfait
f6d93d1151
replace the homemade clearAnsiEscapes with the native stripVTControlCharacters (#13117) 2024-03-07 00:27:59 +01:00
Jordan Pittman
e2dcbad153
Always honor git ignore files (#13119) 2024-03-06 18:24:34 -05:00
Robin Malfait
722f436956
bump versions to 4.0.0-alpha.4 (#13113) 2024-03-06 21:00:27 +01:00
Robin Malfait
9bfc1cc30b
add extension less exports for all exported CSS files (#13110) 2024-03-06 20:56:52 +01:00
Robin Malfait
dd2c68080b
bump versions to 4.0.0-alpha.3 (#13106) 2024-03-06 17:27:17 +01:00
Robin Malfait
99e3fdbceb
drop deprecated decoration-slice and decoration-clone utilities (#13107) 2024-03-06 16:57:23 +01:00
Robin Malfait
813aa45009
[v4] Improve CI by linting before installing playwright browsers (#13105)
* improve CI by linting before building and intalling playwright browsers

* move lint below build
2024-03-06 16:57:13 +01:00
Adam Wathan
b3b2debdd9
[v4] Support old important modifier position (#13103)
* Support old important modifier position

* update

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2024-03-06 10:56:56 -05:00
Robin Malfait
19fcd0ebba
use fs.readFileSync instead of an import (#13104)
In some environments, depending on the Node version importing a `.json`
file without a `with` or `assert` doesn't work.

Let's play it safe and use an `fs.readFileSync` instead.
2024-03-06 10:43:22 -05:00
Robin Malfait
0a2b319ada
bump versions to 4.0.0-alpha.2 2024-03-06 15:13:45 +01:00
Robin Malfait
2ba42fe53d
Copy README file to every package (#13096)
* copy README file to every package

* point workflow status badge to correct workflow file
2024-03-06 08:49:31 -05:00
Robin Malfait
0597489604
Move the CLI to its own package @tailwindcss/cli (#13095)
* move `cli` to its own package `@tailwindcss/cli`

* minify builds when using `tsup`

* prefer tsup cli flag over tsup.config.ts file

* add `--clean`, to make sure `dist/` folders are cleaned before building

* make CLI esm only

* use version of `tailwindcss` instead of the version of `@tailwindcss/cli`
2024-03-06 05:41:12 -05:00
Robin Malfait
bab74da932
Prep alpha release (#13089)
* use `next` as default release channel

* bump versions to `4.0.0-alpha.1`
2024-03-05 14:46:10 -05:00
Kris Braun
abb702bf8f
Add README, LICENSE, and CONTRIBUTING (#13088)
* Add README, LICENSE, CONTRIBUTING, and CODE_OF_CONDUCT

* Add alpha status to README.

* Remove intro sentence

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-03-05 14:45:39 -05:00
Robin Malfait
ca07ca8c69
Only output @property foo once instead of N times (#13087)
* only output `@property foo` once instead of N times

* compute the indent once

* improve performance by using strings and for-loops

* drop unnecessary new line
2024-03-05 18:04:33 +01:00
Robin Malfait
191643f663
pretty print generated CSS by default (#13086)
The pretty printing is fairly basic, but it adds some space between
properties `color: red;`, adds newlines after `;`, `{`, and `}`.

Last but not least, it indents nested CSS based on depth with 2 spaces.
2024-03-05 17:58:17 +01:00
Robin Malfait
86e71194e7
use oxide tag instead of internal tag by default
This will allow us to install `tailwindcss@oxide`
2024-03-05 15:26:37 +01:00