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

Add Link element #130

Merged
merged 3 commits into from
Nov 26, 2018
Merged

Add Link element #130

merged 3 commits into from
Nov 26, 2018

Conversation

oxaudo
Copy link
Member

@oxaudo oxaudo commented Nov 21, 2018

This is an attempt to follow definitions from here: https://app.zeplin.io/project/5acd19ff49a1429169c3128b/screen/5afc758c09a18d3d0f176edd

The code here is just making Link a styled.a that can potentially take noUnderline property or color property. The options generated are here:
screen shot 2018-11-21 at 4 19 12 pm

@artsyit
Copy link
Contributor

artsyit commented Nov 21, 2018

Deploy preview for artsy-palette ready!

Built with commit 656ea68

https://deploy-preview-130--artsy-palette.netlify.com

text-decoration: ${props => (props.color ? "none" : "underline")};
color: ${color("black100")};
}
:focus {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how to actually see this focus state in the browser.

:focus {
border: 1px solid ${color("purple100")};
color: ${props =>
props.color ? color(props.color as any) : color("black100")};
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to cast props.color to any color(props.color as any) because color expects string and we get "black100" | "black80" | "black60" | "black30" | "black10" | "black5" | "purple100" | "purple30" | "purple5" | "green100" | "red100" | "yellow100" | "yellow30" | "yellow10" | "white100" as props.color.... Not sure what was the proper way here

@oxaudo
Copy link
Member Author

oxaudo commented Nov 21, 2018

Also added an issue for that: #129

Not sure what was supposed to be kept there. In checklist it should probably just be a checklist only for an Element, since this Link is an Element. Right?

@damassi
Copy link
Member

damassi commented Nov 21, 2018

If it helps at all note that the base implementation for this is located in our GlobalStyles in Reaction: https://github.com/artsy/reaction/blob/master/src/Styleguide/Elements/GlobalStyles.tsx

(This eventually needs to move over to palette.)

@oxaudo oxaudo changed the title [WIP] - add Link element Add Link element Nov 26, 2018
@oxaudo
Copy link
Member Author

oxaudo commented Nov 26, 2018

@damassi - Thanks for the link! I basically added very similar definitions here. Not sure if/when we could remove the other one, because I'm pretty sure we use a tag directly in Reaction a lot. The idea here is to replace current usage where Link is redefined in Reaction with this Link implementation.

@zephraph - Added a placeholder for ios implementation. Seems like in all the other cases it's just left blank for now. Doing that here as well.

I think I'm ready to test it in Reaction in my super bare implementation and we can definitely iterate here going forward.

@damassi
Copy link
Member

damassi commented Nov 26, 2018

Going to merge this since i'll be using it in a sec!

@damassi damassi merged commit c105883 into artsy:master Nov 26, 2018
@artsyit
Copy link
Contributor

artsyit commented Nov 28, 2018

🎉 This PR is included in version 2.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants