No description
## Problem Using a negative modifier with `theme()` inside an arbitrary value produces no CSS output. - ✅ `ms-[theme(margin.1)]` — works - ✅ `-ms-[10px]` — works - ❌ `-ms-[theme(margin.1)]` — no output ## Cause `negateValue()` in `src/util/negateValue.js` doesn't recognize `theme()` as a negatable function. It falls through all conditions and returns `undefined`, causing the utility to be silently dropped. ## Fix Added `'theme'` to the `numericFunctions` list so `theme()` values get wrapped in `calc(... * -1)`, which the PostCSS `theme()` resolver then processes downstream. ## Tests - **Unit test** (`negateValue.test.js`): `negateValue('theme(margin.1)')` returns `calc(theme(margin.1) * -1)` - **Integration test** (`arbitrary-values.test.js`): `-mt-[theme(spacing.1)]` produces `margin-top: -0.25rem` --------- Co-authored-by: Casey Corcoran <casecorc@amazon.com> Co-authored-by: Robin Malfait <malfait.robin@gmail.com> |
||
|---|---|---|
| .github | ||
| integrations | ||
| jest | ||
| nesting | ||
| perf | ||
| scripts | ||
| src | ||
| standalone-cli | ||
| stubs | ||
| tests | ||
| types | ||
| .editorconfig | ||
| .eslintignore | ||
| .eslintrc.json | ||
| .gitignore | ||
| .swcrc | ||
| base.css | ||
| CHANGELOG.md | ||
| colors.d.ts | ||
| colors.js | ||
| components.css | ||
| defaultConfig.d.ts | ||
| defaultConfig.js | ||
| defaultTheme.d.ts | ||
| defaultTheme.js | ||
| LICENSE | ||
| loadConfig.d.ts | ||
| loadConfig.js | ||
| package-lock.json | ||
| package.json | ||
| plugin.d.ts | ||
| plugin.js | ||
| prettier.config.js | ||
| README.md | ||
| resolveConfig.d.ts | ||
| resolveConfig.js | ||
| screens.css | ||
| tailwind.css | ||
| turbo.json | ||
| utilities.css | ||
| variants.css | ||
A utility-first CSS framework for rapidly building custom user interfaces.
Documentation
For full documentation, visit tailwindcss.com.
Community
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
Discuss Tailwind CSS on GitHub
For casual chit-chat with others using the framework:
Join the Tailwind CSS Discord Server
Contributing
If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.