Skip to content

Conversation

@jrgarciadev
Copy link
Member

Closes: #273

Description

This PR fixes the TypeScript error reported in #273 where defaultConfig cannot be used as a value because it was exported using export type. Additionally, it removes the responsiveVariants feature which is no longer supported in Tailwind CSS v4.

Changes:

  1. Fixed defaultConfig TypeScript export issue

    • Added explicit value export declaration in index.d.ts to allow defaultConfig to be imported and used as a value
    • Removed defaultConfig from types.d.ts and config.d.ts to avoid conflicts with export type * re-exports
    • Fixes the error: 'defaultConfig' cannot be used as a value because it was exported using 'export type'
  2. Removed responsiveVariants feature

    • Removed responsiveVariants property from config.js (no longer supported in Tailwind CSS v4)
    • Removed getScreenVariantValues function and all responsive variants logic from core.js (~105 lines removed)
    • Simplified getVariantValue to handle only string variant keys
    • Object variant keys (previously used for responsive variants) are now ignored
  3. Added comprehensive tests

    • Created defaultConfig.test.ts with 10 test cases covering:
      • Value import/export verification
      • Property modifications (twMerge, twMergeConfig)
      • Integration with tv() and createTV() functions
      • Nested config modifications

Additional context

  • This PR addresses GitHub issue TS error while defining global config #273
  • All 164 tests pass
  • TypeScript compilation succeeds without errors
  • The removal of responsiveVariants aligns with Tailwind CSS v4's removal of config.content.transform support

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Follow the Style Guide.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).

- Fix TypeScript error: defaultConfig cannot be used as a value
  - Add explicit value export in index.d.ts
  - Remove defaultConfig from types.d.ts and config.d.ts to avoid type-only export conflicts

- Remove responsiveVariants feature (no longer supported in Tailwind CSS v4)
  - Remove responsiveVariants from config.js
  - Remove getScreenVariantValues function and related logic from core.js
  - Simplify getVariantValue to handle only string variant keys
  - Remove responsiveVariants tests from defaultConfig.test.ts

- Add comprehensive tests for defaultConfig
  - Test value import/export
  - Test property modifications
  - Test integration with tv and createTV functions
@jrgarciadev jrgarciadev merged commit 65ee73c into main Nov 22, 2025
4 checks passed
@jrgarciadev jrgarciadev deleted the fix/273 branch November 22, 2025 21:23
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.

TS error while defining global config

2 participants