5302 Commits

Author SHA1 Message Date
Robin Malfait
825cd83cca
Add CODEOWNERS file (#14702)
This PR adds a new `CODEOWNERS` file so that the
`@tailwindlabs/engineering` will be automatically requested for review
when changes are made to the repository.
2024-10-17 09:06:05 -04:00
Robin Malfait
c8c3a22442
Bump dependencies to fix vulnerabilities (#14697)
This PR fixes some package vulnerabilities that you will see when
running `npm install`. This PR fixes that by bumping dependencies to get
rid of the vulnerabilities.
2024-10-17 06:41:15 -04:00
Robin Malfait
c616fb9562
3.4.14 v3.4.14 2024-10-15 12:29:17 +02:00
Adam Wathan
b570e2b887
Don't set display: none on elements that use hidden="until-found" (#14625)
Fixes an issue reported by the React Aria Components team here:

https://github.com/adobe/react-spectrum/issues/7160

Basically `hidden="until-found"` behaves very differently than `hidden`
and doesn't actually use `display: none`, so we don't want to apply the
behavior we apply for the regular `hidden` attribute.

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2024-10-09 13:55:48 +02:00
Robin Malfait
ed3c5356b7
3.4.13 v3.4.13 2024-09-23 16:56:58 +02:00
ivan
066ccf8894
Improve the performance when checking broad glob patterns. (#14481)
In a large project, it's costly to repeatedly call the
function `micromatch.isMatch` that parses a glob pattern,
creates a regular expression, and tests the path name
against the regular expression. To optimize performance,
it's important to cache the parsing and creating process
before entering the loop.

For example, the content configuration in a project
looks like this
`['./pages/**/*.{ts,js}', './node_modules/pages/**/*.{ts,js}']`.
If the project has 10000 matched files and 10 glob patterns,
the function `micromatch.isMatch` will be called 100000 times.

---

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2024-09-23 10:52:05 +02:00
Robin Malfait
e8614a268d
3.4.12 v3.4.12 2024-09-17 15:13:09 +02:00
Adam Wathan
fe48ca83d8
Insert @defaults at start of stylesheet (#14427)
Prior to this PR, we'd put all of the `@defaults` (the CSS variables and
stuff) _after_ the `base` rules. This creates an issue when using
`optimizeUniversalDefaults` with CSS that looks like this:

```css
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  input {
    @apply shadow;
  }
}
```

…because the default shadow stuff ends up after the base `input` rules,
so the generated styles are like this:

```css
input {
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color),
    0 1px 2px -1px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
    var(--tw-shadow);
}

input {
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
}
```

This means all of the actual shadow values for the input are reset and
the shadow doesn't work.

Fixes https://github.com/tailwindlabs/tailwindcss/issues/14426.

Lots of failing tests right because this changes a ton of stuff, albeit
in a totally inconsequential way. @thecrypticace if you could update
these for me this week that would be a huge help, just banging this fix
out quick while the kids are napping 😴

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2024-09-17 09:09:08 -04:00
Robin Malfait
818d10ab84
3.4.11 v3.4.11 2024-09-11 19:25:41 +02:00
Robin Malfait
8dd9246a87
update changelog 2024-09-11 19:25:13 +02:00
Robin Malfait
6d9ae82ba3
Allow anchor-size(…) in arbitrary values (#14393)
This PR fixes an issue where using `anchor-size` in arbitrary values
resulted in the incorrect css.

Input: `w-[calc(anchor-size(width)+8px)]`
Output:
```css
.w-\[calc\(anchor-size\(width\)\+8px\)\] {
  width: calc(anchor - size(width) + 8px);
}
```

This PR fixes that, by generating the correct CSS:
```css
.w-\[calc\(anchor-size\(width\)\+8px\)\] {
  width: calc(anchor-size(width) + 8px);
}
```
2024-09-11 19:23:53 +02:00
Jordan Pittman
f07dbff2a7 3.4.10 v3.4.10 2024-08-13 16:24:27 -04:00
Jordan Pittman
c4f23621e1
Bump versions of plugins in the Standalone CLI (#14185)
This PR updates the plugins built into the standalone CLI. The bundled
versions here are several versions behind (whoops).
2024-08-13 16:16:49 -04:00
Robin Malfait
f65023efb9
3.4.9 v3.4.9 2024-08-08 15:10:38 +02:00
Philipp Spiess
702ba6aaee
Don't warn about broad globs in vendor folders (#14147)
After shipping the new warning that prevents unexpected scanning of all
dependencies in 3.4.8, we noticed that it was firing more often than we
wanted to.

The heuristics we added works by finding broad glob patterns (once that
contain `/**/`) and when those are found and are the _sole pattern used
to match a file of a known-large directory_, we were showing the
warning. The motivation for this is that we have seen time and time
again that an incorrect config like `/**/*.js` can cause recursive scans
through _all_ dependencies including many minified libraries which
greatly impacts performance.

In #14140, we were adding two known-large directory names: 

- `node_modules` (used by npm)
- `vendor` (used by PHP)

The problem with the `vendor` name though is that it is more generic
than we would like it and there are legit use cases to have a folder
named `vendor` inside your component folder. Additionally, PHP vendors
behave a bit differently and it's not super common to have minified
build files in that folder (which is one of the main reasons for the
slow builds). Because of this, we decided to revert the change for
`vendor` and only scan for `node_modules` going forward.
2024-08-08 15:05:52 +02:00
Robin Malfait
1676118af9
3.4.8 v3.4.8 2024-08-07 17:26:53 +02:00
Robin Malfait
69c81f2583
rename master to main 2024-08-07 17:18:38 +02:00
Robin Malfait
858696a8bc
Warn when broad glob patterns are used in the content configuration (#14140)
When you use a glob pattern in your `content` configuration that is too
broad, it could be that you are accidentally including files that you
didn't intend to include. E.g.: all of `node_modules`

This has been documented in the [Tailwind CSS
documentation](https://tailwindcss.com/docs/content-configuration#pattern-recommendations),
but it's still something that a lot of people run into.

This PR will try to detect those patterns and show a big warning to let
you know if you may have done something wrong.

We will show a warning if all of these conditions are true:

1. We detect `**` in the glob pattern
2. _and_ you didn't explicitly use `node_modules` in the glob pattern
3. _and_ we found files that include `node_modules` in the file path
4. _and_ no other globs exist that explicitly match the found file

With these rules in place, the DX has nice trade-offs:

1. Very simple projects (that don't even have a `node_modules` folder),
can simply use `./**/*` because while resolving actual files we won't
see files from `node_modules` and thus won't warn.
2. If you use `./src/**` and you do have a `node_modules`, then we also
won't complain (unless you have a `node_modules` folder in the `./src`
folder).
3. If you work with a 3rd party library that you want to make changes
to. Using an explicit match like `./node_modules/my-package/**/*` is
allowed because `node_modules` is explicitly mentioned.

Note: this only shows a warning, it does not stop the process entirely.
The warning will be show when the very first file in the `node_modules`
is detected.

<!--

👋 Hey, thanks for your interest in contributing to Tailwind!

**Please ask first before starting work on any significant new
features.**

It's never a fun experience to have your pull request declined after
investing a lot of time and effort into a new feature. To avoid this
from happening, we request that contributors create an issue to first
discuss any significant new features. This includes things like adding
new utilities, creating new at-rules, or adding new component examples
to the documentation.


https://github.com/tailwindcss/tailwindcss/blob/master/.github/CONTRIBUTING.md

-->

---------

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2024-08-07 16:55:20 +02:00
Jordan Pittman
1f23c2e842
Bump to latest cssnano v6 (#14105)
We bundle cssnano in our CLI and it's on an older version that does not
handle nested CSS correctly. This PR updates it to the latest version of
v6.x

Fixes #14092
2024-08-02 08:57:14 -04:00
Jordan Pittman
28bd90eefb
Automate checksum generation for standalone CLI (#14081) 2024-08-01 10:02:25 -04:00
Adam Wathan
9824cb64a0 Update version in package.json v3.4.7 2024-07-25 09:20:52 -04:00
Adam Wathan
aa6c10f67f Add missing heading to changelog 2024-07-25 09:16:26 -04:00
Adam Wathan
245058c7fd Update changelog for v3.4.7 2024-07-25 09:06:56 -04:00
Philipp Spiess
605d8cd5eb
Update CHANGELOG.md 2024-07-25 10:13:56 +02:00
Philipp Spiess
680c55c11c
Normalize attribute selector for data-* and aria-* modifiers (#14037)
Fixes #14026 
See #14040 for the v4 fix

When translating `data-` and `aria-` modifiers with attribute selectors,
we currently do not wrap the target attribute in quotes. This only works
for keywords (purely alphabetic words) but breaks as soon as there are
numbers or things like spaces in the attribute:

```html
<div data-id="foo" class="data-[id=foo]:underline">underlined</div>
<div data-id="f1" class="data-[id=1]:underline">not underlined</div>
<div data-id="foo bar" class="data-[id=foo_bar]:underline">not underlined</div>
```

Since it's fairly common to have attribute selectors with `data-` and
`aria-` modifiers, this PR will now wrap the attribute in quotes unless
these are already wrapped.

| Tailwind Modifier  | CSS Selector |
| ------------- | ------------- |
| `.data-[id=foo]`  | `[data-id='foo']`  |
| `.data-[id='foo']`  | `[data-id='foo']`  |
| `.data-[id=foo_i]`  | `[data-id='foo i']`  |
| `.data-[id='foo'_i]`  | `[data-id='foo' i]`  |
| `.data-[id=123]`  | `[data-id='123']`  |

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2024-07-24 18:46:21 +02:00
Philipp Spiess
866860e6a6
Print eventual lightning CSS parsing errors when the CSS matcher fail (#14034) 2024-07-23 14:40:11 +02:00
Jordan Pittman
bdc87ae1d7
Fix class detection in Slim templates with attached attributes and IDs (#14019)
* Fix class detection in Slim templates with attached attributes and IDs

* Update changelog

* Tweak regex
2024-07-18 11:21:20 -04:00
Jordan Pittman
d622977b2a Update changelog v3.4.6 2024-07-16 10:52:51 -04:00
Josh Wilson
0573c0769a
Loosen :is() wrapping rules in applyImportantSelector for more readable output. (#13900) 2024-07-16 10:51:45 -04:00
Jordan Pittman
9c29e47c5f 3.4.6 2024-07-16 09:37:15 -04:00
Jordan Pittman
daa5266081 Update changelog 2024-07-16 09:36:07 -04:00
Georg Ledermann
ae6a8d532b
Fix extracting utilities from slim/pug templates (#14006)
A class name starting with number like `2xl:bg-red-500` must not be removed.

Resolves #14005
2024-07-16 09:34:20 -04:00
Jordan Pittman
a0dbb3d876 Update runner image v3.4.5 2024-07-15 11:07:30 -04:00
Jordan Pittman
10a1197989 3.4.5 2024-07-15 10:56:16 -04:00
Adam Wathan
9033d625e1
Always generate -webkit-backdrop-filter property (#13997)
* Always generate -webkit-backdrop-filter property

* Update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-07-12 20:48:08 -04:00
Adam Wathan
074736c1d6
Avoid over-extracting utilities from candidates with decimal values (#13959)
* Avoid over-extracting utilities from candidates with decimal values

Prevent candidates like `px-1.5` from generating both the `px-1.5` class and the `px-1` class.

* Update CHANGELOG.md

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-07-05 14:46:51 -04:00
Robin Malfait
588a8225eb
Add .mts and .cts config file detection (#13940)
* add `tailwind.config.cts` and `tailwind.config.mts` as default config files

* always use jiti when working with ESM or TS files

* update changelog

* add integration test for `.cts` and `.mts` configuration files
2024-07-03 23:09:35 +02:00
Simon He
0de1f0cce4
refactor(util): code refactor (#13872)
* refactor(util): code refactor

* refactor(util): code refactor
2024-06-24 09:13:12 -04:00
Simon He
a61e5aa06b
fix: typo (#13864) 2024-06-20 06:02:11 -04:00
Robin Malfait
eef91c9065
Use no value instead of blur(0px) for backdrop-blur-none and blur-none utilities (#13830)
* map `backdrop-blur-none` and `blur-none` to ` ` instead of `blur(0px)`

* add test for `backdrop-blur-none` and `blur-none`

* update changelog
2024-06-13 15:49:59 +02:00
Jordan Pittman
9e928ce0be
Disable automatic var() injection for anchor properties (#13826)
* Disable automatic `var()` injection for CSS anchor positioning properties

* Update tests

* Update changelog
2024-06-13 09:19:08 -04:00
Jordan Pittman
ff6f085da2 3.4.4 v3.4.4 2024-06-05 12:55:54 -04:00
Jordan Pittman
ed024eeb09 Update changelog 2024-06-05 12:54:06 -04:00
Jordan Pittman
325e7c03ce
Bump deps (#13797) 2024-06-05 12:53:06 -04:00
Jordan Pittman
56116b0904
Update browserslist database (#13792) 2024-06-05 09:55:47 -04:00
Jordan Pittman
8d66d94182
[v3] Support negative values for {col,row}-{start,end} utilities (#13781)
* Support negative values for `{col,row}-{start,end}` utilities

* Add tests

* Update changelog
2024-06-03 11:34:27 -04:00
victor
669109efdd
Don't prefix classes in arbitrary values of has-*, group-has-*, and peer-has-* variants (#13770)
* Added tests to verify that classes are prefixed when using `has-*` variants with arbitrary values

* Fix test

* Don't prefix classes in arbitrary values in `has-*` variants

* Update changelog

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2024-05-31 20:01:09 -04:00
Maxwell Barvian
9fda4616eb
Fix multiple <alpha-value> in color definitions (#13740)
* Fix multiple <alpha-value> in color definitions

Fixes #13716

* Update CHANGELOG.md

* Use `replace` with global regex

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2024-05-29 11:32:48 -04:00
Jordan Pittman
f1f419a9ec 3.4.3 v3.4.3 2024-03-27 15:18:37 -04:00
Jordan Pittman
e6c1082823
Revert changes to glob handling (#13384)
* Revert "Improve glob handling for folders with `(`, `)`, `[` or `]` in the file path (#12715)"

This reverts commit f2a7c2c4532b76d61351f1ca7e26ec8c93729b5d.

* Update changelog
2024-03-27 15:16:52 -04:00