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

feat: add class manipulation via functions #12

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jaulz
Copy link
Contributor

@jaulz jaulz commented Dec 9, 2021

This PR allows is a bit more complex but I think the changes will allow much more flexibility. Classes passed via props do not override the classes from variants by default anymore. If you pass undefined it will still clear the variant classes but for other values it will merge them. However, now you can also pass a function to the class object which allows you to manipulate the previous classes:
image

P.S.: the hasProperty function might lead to some type issues at the moment because it merges the object with Record<Y, unknown> and in case Y is a generic string it will basically extend all properties with & unknown.

@alfonsobries
Copy link
Contributor

@jaulz do you think you can remove the prettier stuff? its not like I am against it but I prefer further discussions since we already have eslint and I don't want to use different settings on the packages, in other words we can create separate PRs for that

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.

2 participants