Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to define the prefix for generated names #225

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

jantimon
Copy link
Collaborator

@jantimon jantimon commented Dec 3, 2024

I've added support for configuring the prefix used by next-yak for generated CSS classes and variables
This can help in identifying yak-generated classes in tests or to avoid collisions with other libraries

The default prefix remains y in production and empty in dev mode, so this is fully backwards compatible

If needed you can now configure a custom prefix:

// next.config.js
export default withYak({
  prefix: 'my-app-'
});

The patch also adjusts the dev mode variable prefix from 'yak_' to 'var_' which makes a bit more sense semantically

Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: 50b1eb5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
yak-swc Minor
next-yak Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jantimon jantimon requested a review from Mad-Kat December 3, 2024 12:52
Copy link

codspeed-hq bot commented Dec 3, 2024

CodSpeed Performance Report

Merging #225 will degrade performances by 12.16%

Comparing feature/custom-prefix (50b1eb5) with main (eabe5d8)

Summary

❌ 1 (👁 1) regressions
✅ 1 untouched benchmarks

Benchmarks breakdown

Benchmark main feature/custom-prefix Change
👁 render KanjiLetterComponentYak 280.7 ms 319.5 ms -12.16%

.changeset/silver-hairs-clean.md Show resolved Hide resolved
@jantimon jantimon merged commit fcba925 into main Dec 3, 2024
8 checks passed
@jantimon jantimon deleted the feature/custom-prefix branch December 3, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants