-
Notifications
You must be signed in to change notification settings - Fork 64
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
fix: simplify interpolation handling #418
Conversation
@@ -15,43 +11,25 @@ export interface BeforeInterpolation { | |||
} | |||
|
|||
/** | |||
* Will return any suffix out of the CSS and return them both. | |||
* Will remove any suffix out of the CSS and return them both. | |||
* | |||
* E.g. `'px;font-size: 20px;'` would return `"px"` as the suffix and `";font-size: 20px;"` as the CSS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add examples for more cases? Like when regex matched and when not. Might be helpful in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea
@@ -62,39 +40,17 @@ export const cssAfterInterpolation = (css: string): AfterInterpolation => { | |||
* @param css all the CSS before the interpolation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some examples here too? hehe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
Looks good. Love that we have cleaned messy code hehe. If possible just add few examples in jsdoc which will be helpful for future developers. |
all done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR simplifies the interpolation handling by making more assumptions, and handling only things that would actually happen. Obviously invalid suffix/prefixes and the like are now unsupported.
Closes #413
Closes #345