From 37e2033a4bf7980ec31e5b3f3524c998c0ea46d8 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Fri, 15 Nov 2024 17:53:44 +0100 Subject: [PATCH 1/3] move flex near the display utilities --- packages/tailwindcss/src/utilities.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/tailwindcss/src/utilities.ts b/packages/tailwindcss/src/utilities.ts index 2e2397cae0af..b03b51074362 100644 --- a/packages/tailwindcss/src/utilities.ts +++ b/packages/tailwindcss/src/utilities.ts @@ -812,6 +812,7 @@ export function createUtilities(theme: Theme) { staticUtility('table-row-group', [['display', 'table-row-group']]) staticUtility('table-row', [['display', 'table-row']]) staticUtility('flow-root', [['display', 'flow-root']]) + staticUtility('flex', [['display', 'flex']]) staticUtility('grid', [['display', 'grid']]) staticUtility('inline-grid', [['display', 'inline-grid']]) staticUtility('contents', [['display', 'contents']]) @@ -932,10 +933,7 @@ export function createUtilities(theme: Theme) { // generate `flex: 1`. Our `functionalUtility` helper can't handle two properties // using the same namespace, so we handle this one manually. utilities.functional('flex', (candidate) => { - if (!candidate.value) { - if (candidate.modifier) return - return [decl('display', 'flex')] - } + if (!candidate.value) return if (candidate.value.kind === 'arbitrary') { if (candidate.modifier) return From 6bda74df34293da58010e1a0eab5123cc9ce361f Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Fri, 15 Nov 2024 17:53:53 +0100 Subject: [PATCH 2/3] suggest `flex` as class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🙈 --- packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap b/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap index 0ccdfa90546f..0f4b573651c0 100644 --- a/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap +++ b/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap @@ -3718,6 +3718,7 @@ exports[`getClassList 1`] = ` "fill-transparent/95", "fill-transparent/100", "fixed", + "flex", "flex-auto", "flex-col", "flex-col-reverse", From 002e6f410c9592594ced3ee105f03d0bd441c0f4 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Fri, 15 Nov 2024 17:56:05 +0100 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dafd6313891..e5dbf0cd925a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Ensure `flex` is suggested ([#15014](https://github.com/tailwindlabs/tailwindcss/pull/15014)) + ### Changed - Bring back support for color opacity modifiers to read from `--opacity-*` theme values ([#14278](https://github.com/tailwindlabs/tailwindcss/pull/14278))