mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
This PR is an umbrella PR where we will add support for the new `@source` directive. This will allow you to add explicit content glob patterns if you want to look for Tailwind classes in other files that are not automatically detected yet. Right now this is an addition to the existing auto content detection that is automatically enabled in the `@tailwindcss/postcss` and `@tailwindcss/cli` packages. The `@tailwindcss/vite` package doesn't use the auto content detection, but uses the module graph instead. From an API perspective there is not a lot going on. There are only a few things that you have to know when using the `@source` directive, and you probably already know the rules: 1. You can use multiple `@source` directives if you want. 2. The `@source` accepts a glob pattern so that you can match multiple files at once 3. The pattern is relative to the current file you are in 4. The pattern includes all files it is matching, even git ignored files 1. The motivation for this is so that you can explicitly point to a `node_modules` folder if you want to look at `node_modules` for whatever reason. 6. Right now we don't support negative globs (starting with a `!`) yet, that will be available in the near future. Usage example: ```css /* ./src/input.css */ @import "tailwindcss"; @source "../laravel/resources/views/**/*.blade.php"; @source "../../packages/monorepo-package/**/*.js"; ``` It looks like the PR introduced a lot of changes, but this is a side effect of all the other plumbing work we had to do to make this work. For example: 1. We added dedicated integration tests that run on Linux and Windows in CI (just to make sure that all the `path` logic is correct) 2. We Have to make sure that the glob patterns are always correct even if you are using `@import` in your CSS and use `@source` in an imported file. This is because we receive the flattened CSS contents where all `@import`s are inlined. 3. We have to make sure that we also listen for changes in the files that match any of these patterns and trigger a rebuild. PRs: - [x] https://github.com/tailwindlabs/tailwindcss/pull/14063 - [x] https://github.com/tailwindlabs/tailwindcss/pull/14085 - [x] https://github.com/tailwindlabs/tailwindcss/pull/14079 - [x] https://github.com/tailwindlabs/tailwindcss/pull/14067 - [x] https://github.com/tailwindlabs/tailwindcss/pull/14076 - [x] https://github.com/tailwindlabs/tailwindcss/pull/14080 - [x] https://github.com/tailwindlabs/tailwindcss/pull/14127 - [x] https://github.com/tailwindlabs/tailwindcss/pull/14135 Once all the PRs are merged, then this umbrella PR can be merged. > [!IMPORTANT] > Make sure to merge this without rebasing such that each individual PR ends up on the main branch. --------- Co-authored-by: Philipp Spiess <hello@philippspiess.com> Co-authored-by: Jordan Pittman <jordan@cryptica.me> Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
12 KiB
12 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
Added
- Add support for
inlineoption when defining@themevalues (#14095) - Add
inertvariant (#14129) - Add support for explicitly registering content paths using new
@sourceat-rule (#14078)
[4.0.0-alpha.18] - 2024-07-25
Fixed
- Discard invalid classes such as
bg-red-[#000](#13970) - Fix parsing body-less at-rule without terminating semicolon (#13978)
- Ensure opacity modifier with variables work with
color-mix()(#13972) - Discard invalid
variantsandutilitieswith modifiers (#13977) - Add missing utilities that exist in v3, such as
resize,fill-none,accent-none,drop-shadow-none, and negativehue-rotateandbackdrop-hue-rotateutilities (#13971) - Don’t allow at-rule-only variants to be compounded (#14015)
- Ensure compound variants work with variants with multiple selectors (#14016)
- Ensure attribute values in
data-*andaria-*modifiers are always quoted in the generated CSS (#14040)
Added
- Add support for basic
addVariantplugins with new@plugindirective (#13982, #14008) - Add
@variantat-rule for defining custom variants in CSS (#13992, #14008) - Add
@utilityat-rule for defining custom utilities in CSS (#14044)
Changed
- Reduce the specificity of the
*variant so those styles can be overridden by child elements (#14056)
[4.0.0-alpha.17] - 2024-07-04
Added
- Add
rounded-4xlutility (#13827) - Add
backdrop-blur-noneandblur-noneutilities (#13831) - Include variable in output for bare utilities like
rounded(#13836)
Fixed
- Support combining arbitrary shadows without a color with shadow color utilities (#13876)
- Ensure
@propertyfallbacks work correctly with properties with noinitial-value(#13949)
[4.0.0-alpha.16] - 2024-06-07
Fixed
- Use
lengthdata type forbackground-sizeinstead ofbackground-position(#13771) - Support negative values for
{col,row}-{start,end}utilities (#13780) - Use long form
<length> | <percentage>syntax for properties (#13660) - Fix background position value of
bg-right-top,bg-right-bottom,bg-left-bottomandbg-left-top(#13806)
Added
- Add
nth-*variants (#13661) - Add
bg-linear-*utilities as an alias for the existingbg-gradient-*utilities (#13783) - Support arbitrary linear gradient angles (e.g.
bg-linear-[125deg]) (#13783)
[4.0.0-alpha.15] - 2024-05-08
Fixed
- Make sure
contain-*utility variables resolve to a valid value (#13521) - Support unbalanced parentheses and braces in quotes in arbitrary values and variants (#13608)
- Add fallbacks for
@propertyrules for Firefox (#13655)
Changed
- Use
remunits for breakpoints by default instead ofpx(#13469) - Use natural sorting when sorting classes (#13507, #13532)
[4.0.0-alpha.14] - 2024-04-09
Fixed
- Ensure deterministic SSR builds in
@tailwindcss/vite(#13457)
Changed
- Apply variants from left to right instead of inside-out (#13478)
- Don't special-case
[hidden]elements inspace-*/divide-*utilities (#13459)
[4.0.0-alpha.13] - 2024-04-04
Fixed
- Always inline values for
shadow-*utilities to ensure shadow colors work correctly (#13449)
[4.0.0-alpha.12] - 2024-04-04
Fixed
- Enable Vite's
waitForRequestsIdle()for client requests only (#13394) - Make sure
::first-letterrespects::selectionstyles (#13408)
[4.0.0-alpha.11] - 2024-03-27
Added
- Make
rotate-x/y/z-*utilities composable (#13319) - Apply Vite's CSS plugin transform to Tailwind-generated CSS in
@tailwindcss/vite(e.g. inlining images) (#13218) - Add
startingvariant for@starting-style(#13329) - Target
:popover-openin existingopenvariant (#13331)
Fixed
- Remove percentage values for
translate-zutilities (#13321, #13327) - Generate unique CSS bundle hashes in
@tailwindcss/vitewhen Tailwind-generated CSS changes (#13218) - Inherit letter spacing in form controls (#13328)
- Ensure
buildcommand is executed when using--outputinstead of-o(#13369) - Prevent
@tailwindcss/vitefrom hanging in serve mode (#13380)
[4.0.0-alpha.10] - 2024-03-19
Added
Fixed
- Validate bare values (#13245)
- Parse candidates in
.sveltefiles withclass:abc="condition"syntax (#13274)
Changed
- Inline
@importrules intailwindcss/index.cssat publish time for better performance (#13233) - Include custom properties with fallbacks in utility class values (#13177)
[4.0.0-alpha.9] - 2024-03-13
Added
- Support
@theme reference { … }for defining theme values without emitting variables (#13222)
Fixed
- Fix incorrect properties in line-clamp utilities (#13220)
- Don't rely on existence of
--default-transition-*variables intransition-*utilities (#13219)
Changed
- Move
optimizeCssto the packages where it's used (#13230)
[4.0.0-alpha.8] - 2024-03-11
Fixed
- Ensure
scale-*utilities support percentage values (#13182) - Prevent
content-nonefrom being overridden when conditionally styling::before/::after(#13187) - Remove default borders from
iframeelements (#13189)
Changed
- Replace
--radius-noneand--radius-fulltheme values with staticrounded-noneandrounded-fullutilities (#13186)
Added
- Improve performance of incremental rebuilds for
@tailwindcss/cli(#13169) - Improve performance of incremental rebuilds for
@tailwindcss/postcss(#13170)
[4.0.0-alpha.7] - 2024-03-08
Added
- Add
font-stretchutilities (#13153) - Publish packages with npm provenance (#13160)
- Build native packages for Android (#13115, #13161)
- Make CSS optimization and minification configurable in PostCSS plugin and CLI (#13130)
Fixed
- Don't error on
@applywith leading/trailing whitespace (#13144) - Correctly parse CSS using Windows line endings (#13162)
[4.0.0-alpha.6] - 2024-03-07
Fixed
- Only set
border-stylefor appropriate border side (#13124)
Changed
- Error when
@themecontains unsupported rules/declarations (#13125)
[4.0.0-alpha.5] - 2024-03-06
Fixed
- Don't scan ignored files even if a
.gitfolder is not present (#13119)
[4.0.0-alpha.4] - 2024-03-06
Fixed
- Support importing framework CSS files without including a
.cssextension (#13110)
[4.0.0-alpha.3] - 2024-03-06
Added
- Support putting the important modifier at the beginning of a utility (#13103)
Fixed
- Node compatibility fix (#13104)
Changes
- Drop deprecated
decoration-sliceanddecoration-cloneutilities (#13107)
[4.0.0-alpha.2] - 2024-03-06
Changed
- Move the CLI into a separate
@tailwindcss/clipackage (#13095)