Skip to content

Conversation

thecrypticace
Copy link
Contributor

Fixes #1236

This PR fixes an issue where we'd show a syntax error for multi-word namespace resets like --font-weight-*: initial;:

@theme {
  --font-*: initial; /* this one is fine */
  --font-weight-*: initial; /* this one shows a syntax error */
}
Screenshot 2025-02-26 at 12 16 38

Now both work as expected:

Screenshot 2025-02-26 at 12 17 09


// Replace `--some-var-*` with `--some-var-_`
css = css.replace(/--([a-zA-Z0-9]+)-[*]/g, '--$1_')
css = css.replace(/--([a-zA-Z0-9-]+)-[*]/g, '--$1-_')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right?! lol

@thecrypticace thecrypticace merged commit 4cb548e into main Feb 26, 2025
@thecrypticace thecrypticace deleted the fix/theme-key-namespace-reset branch February 26, 2025 17:52
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.

Regression in v0.14.7: Font weight reset of defaults in @theme shows errors

2 participants