Skip to content

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

Merged
merged 11 commits into from
Feb 16, 2021
Merged

Styled -> Apply #3

merged 11 commits into from
Feb 16, 2021

Conversation

just214
Copy link
Collaborator

@just214 just214 commented Feb 16, 2021

This PR addresses #2 , and updates all components to use currently available features (tw, apply) until the styled api is officially released. Other changes include dependency updates, expanded props, and various component style refactors.

@just214 just214 requested a review from sastan February 16, 2021 18:29
@just214 just214 added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 16, 2021
@just214 just214 self-assigned this Feb 16, 2021
Copy link
Collaborator

@sastan sastan left a 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.

import { __DEV__ } from '../utils';

const SIZES_MAP = {
sm: 'px-3 py-1 text-xs',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use lazy here?

@@ -23,3 +24,7 @@ export const logClassNames = (
console.log(classNames);
}
};

export function lazy(arg: TemplateStringsArray) {
Copy link
Collaborator

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);
}

Copy link
Collaborator Author

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.

@just214 just214 requested a review from sastan February 16, 2021 19:30
@sastan
Copy link
Collaborator

sastan commented Feb 16, 2021

That was fast. Great job!

@sastan sastan merged commit be287cf into main Feb 16, 2021
@just214 just214 deleted the styled-to-applied branch February 16, 2021 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants