Skip to content

Conversation

@ch-jwoo
Copy link

@ch-jwoo ch-jwoo commented May 4, 2025

issue

themeReplacements is only working when string is fully matched
Sometimes it causes inconvenience.

inconvenience case:

/** tailwind.config.js */
/** ... */
theme: {
  borderRadius: {
  lg: 'var(--radius)',
  md: 'calc(var(--radius) - 2px)',
  sm: 'calc(var(--radius) - 4px)',
  },
}

/** ... */
configViewer: {
  themeReplacements: {
    'var(--radius)': '0.2rem'
    'calc(var(--radius) - 2px)': 'calc(0.2rem - 2px)' // inconvenience
    'calc(var(--radius) - 4px)': 'calc(0.2rem - 4px)' // inconvenience
  }
}

solve

themeReplacements will work when string matched partially.

side effect

themeReplacements can work on unintended place which string is not fully matched.

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.

1 participant