Skip to content

Commit f93bd87

Browse files
committed
feature flag --value('…') and --modifier('…')
1 parent 78cf697 commit f93bd87

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- _Experimental_: Add `user-valid` and `user-invalid` variants ([#12370](https://github.com/tailwindlabs/tailwindcss/pull/12370))
2020
- _Experimental_: Add `wrap-anywhere`, `wrap-break-word`, and `wrap-normal` utilities ([#12128](https://github.com/tailwindlabs/tailwindcss/pull/12128))
2121
- _Experimental_: Add `@source inline(…)` ([#17147](https://github.com/tailwindlabs/tailwindcss/pull/17147))
22+
- _Experimental_: Add support for literal values in `--value('…')` and `--modifier('…')` ([#17304](https://github.com/tailwindlabs/tailwindcss/pull/17304))
2223

2324
## [4.0.16] - 2025-03-25
2425

25-
### Added
26-
27-
- Add support for literal values in `--value('…')` and `--modifier('…')` ([#17304](https://github.com/tailwindlabs/tailwindcss/pull/17304))
28-
2926
### Fixed
3027

3128
- Fix class extraction followed by `(` in Pug ([#17320](https://github.com/tailwindlabs/tailwindcss/pull/17320))

packages/tailwindcss/src/feature-flags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export const enableScripting = process.env.FEATURES_ENV !== 'stable'
77
export const enableSourceInline = process.env.FEATURES_ENV !== 'stable'
88
export const enableUserValid = process.env.FEATURES_ENV !== 'stable'
99
export const enableWrapAnywhere = process.env.FEATURES_ENV !== 'stable'
10+
export const enableCssLiterals = process.env.FEATURES_ENV !== 'stable'

packages/tailwindcss/src/utilities.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ import {
1111
} from './ast'
1212
import type { Candidate, CandidateModifier, NamedUtilityValue } from './candidate'
1313
import type { DesignSystem } from './design-system'
14-
import { enableBaselineLast, enableSafeAlignment, enableWrapAnywhere } from './feature-flags'
14+
import {
15+
enableBaselineLast,
16+
enableCssLiterals,
17+
enableSafeAlignment,
18+
enableWrapAnywhere,
19+
} from './feature-flags'
1520
import type { Theme, ThemeKey } from './theme'
1621
import { compareBreakpoints } from './utils/compare-breakpoints'
1722
import { DefaultMap } from './utils/default-map'
@@ -4835,6 +4840,7 @@ export function createCssUtility(node: AtRule) {
48354840
for (let node of fn.nodes) {
48364841
// Track literal values
48374842
if (
4843+
enableCssLiterals &&
48384844
node.kind === 'word' &&
48394845
(node.value[0] === '"' || node.value[0] === "'") &&
48404846
node.value[0] === node.value[node.value.length - 1]
@@ -5037,6 +5043,7 @@ function resolveValueFunction(
50375043
for (let arg of fn.nodes) {
50385044
// Resolve literal value, e.g.: `--modifier('closest-side')`
50395045
if (
5046+
enableCssLiterals &&
50405047
value.kind === 'named' &&
50415048
arg.kind === 'word' &&
50425049
// Should be wreapped in quotes

0 commit comments

Comments
 (0)