Refactor css utils calc classes#1419
Closed
rowan-gud wants to merge 6 commits intovanilla-extract-css:masterfrom
Closed
Refactor css utils calc classes#1419rowan-gud wants to merge 6 commits intovanilla-extract-css:masterfrom
rowan-gud wants to merge 6 commits intovanilla-extract-css:masterfrom
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CSS-utils
Motivation
I have found myself wanting more CSS utils. I have refactored the
calcutil to use classes to do the chaining in hopes that it will be a little bit of an easier structure to follow. I have a couple more PRs that can be opened if people are interested in this idea! I realize that this is not linked to an issue but I just thought it would be cool and started working on it.Changes
The
calcfunction now returns a class with the same methods as before but now has context on what operator the sub expressions are using and so can try to group the expression in a logical way. The actual changes in functionality here are very minimal but this class based implementation gives a structure to follow for the other changes I mention later.Example
Current implementation:
This implementation:
Future Changes
The main reason for doing this is to add more functions to the css-utils packages. Some that I was thinking of are:
transitionanimationpx,rem(super simple)transform- This one I'm really excited about! My lines are getting reaaally long and multiline strings are not the prettiest thing to look atClosing Thoughts
I would mostly just like feedback on this PR. I'm sure there're things that I've missed / overlooked. Also, let me know if you would like this transitioned into an issue I just wanted to provide some code as context!
EDIT: I started a discussion #1420