Skip to content

Add suggestions for named opacity modifiers - #20287

Merged
RobinMalfait merged 4 commits into
mainfrom
fix/issue-intellisense-1541
Jun 29, 2026
Merged

RobinMalfait merged 4 commits into
mainfrom
fix/issue-intellisense-1541

Conversation

@RobinMalfait

@RobinMalfait RobinMalfait commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

This PR re-enables suggestions for named opacity modifiers that can be configured via the --opacity-* namespace.

Before we launched v4, we got rid of this feature: #14278 & #14339
But later we re-added the feature, without updating intellisense suggestions: #15009

This PR re-adds suggestions for utilities that read from the --opacity-* namespace for named modifiers. A lot of utilities use some internal abstraction that get this for free once we use the colorUtility setup, but some utilities don't use these, and I had to add the --opacity modifier theme key manually.

Fixes: tailwindlabs/tailwindcss-intellisense#1541

Test plan

  1. Update intellisense related tests now that we read from the --opacity-* namespace
  2. All tests pass

Before:
file-5462b830c5ebbd6046494713344ff5ff

After:

file-9247e05165f72e8bb974673ee17bd35a

Notice that the /foo suggestion is available

@RobinMalfait
RobinMalfait requested a review from a team as a code owner June 29, 2026 11:07
@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: af644dd7-7393-4e98-bc8a-2c9f646b1853

📥 Commits

Reviewing files that changed from the base of the PR and between ccb0fbe and b604097.

📒 Files selected for processing (1)
  • integrations/upgrade/index.test.ts

Walkthrough

In packages/tailwindcss/src/utilities.ts, modifierThemeKeys: ['--opacity'] was added to the suggest(...) configuration objects for color-related utility suggestion groups. CHANGELOG.md was updated with an Unreleased note about named opacity modifiers from --opacity theme values. integrations/upgrade/index.test.ts was updated with a formatting change and an inline snapshot change for opacity namespace values.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed It clearly summarizes the main change: adding suggestions for named opacity modifiers.
Description check ✅ Passed The description matches the code changes and the issue goal of re-enabling opacity modifier suggestions.
Linked Issues check ✅ Passed The added --opacity modifier theme keys and test updates address issue #1541's missing slash-opacity suggestions.
Out of Scope Changes check ✅ Passed The changelog and test edits are directly related to the opacity suggestion change.

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — changes are additive and confined to IntelliSense metadata; no runtime CSS generation logic is touched.

The change is a narrow, mechanical addition of modifierThemeKeys: ['--opacity'] to utility definitions that already have matching modifiers arrays. Every affected call site follows the same pattern, the snapshot confirms the expected suggestion list, and the upgrade test update is consistent with the tool now preferring named opacity forms when they match a migrated theme value.

No files require special attention.

Reviews (3): Last reviewed commit: "update integration tests" | Re-trigger Greptile

Now that we suggest modifiers based on the `--opacity` namespace, these
upgrades can stay the same.
@RobinMalfait
RobinMalfait merged commit c8b081d into main Jun 29, 2026
9 checks passed
@RobinMalfait
RobinMalfait deleted the fix/issue-intellisense-1541 branch June 29, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opacity variables are supported but not suggested

1 participant