-
Notifications
You must be signed in to change notification settings - Fork 0
Styled -> Apply #3
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
Conversation
…default props, various improvements
…west implementations
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.
Awesome! Thank you so much.
src/components/Input.tsx
Outdated
import { __DEV__ } from '../utils'; | ||
|
||
const SIZES_MAP = { | ||
sm: 'px-3 py-1 text-xs', |
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.
Maybe use lazy
here?
src/utils/index.ts
Outdated
@@ -23,3 +24,7 @@ export const logClassNames = ( | |||
console.log(classNames); | |||
} | |||
}; | |||
|
|||
export function lazy(arg: TemplateStringsArray) { |
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.
This would only work for non-interpolated tagged templates. The following function would allow interpolations:
import type { Token } from 'twind';
function lazy(arg: TemplateStringsArray, ...interpolations: Token) {
return ({ tw }: Context) => tw(arg, ...interpolations);
}
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 call...I got in a bit of a rush and forgot to account for the interpolations.
That was fast. Great job! |
This PR addresses #2 , and updates all components to use currently available features (
tw
,apply
) until thestyled
api is officially released. Other changes include dependency updates, expanded props, and various component style refactors.