Skip to content

How do I add bottom border? #140

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

Closed
resting opened this issue Apr 23, 2020 · 5 comments
Closed

How do I add bottom border? #140

resting opened this issue Apr 23, 2020 · 5 comments

Comments

@resting
Copy link

resting commented Apr 23, 2020

Have the following component, but the border bottom doesn't appear

const StyledForgotPasswordText = styled.Text`
  font-size: 14px;
  text-align: right;
  border-bottom-color: black;
  border-bottom-width: 2px;
`;

The generated CSS here looks fine:

{
  "fontSize": 14,
  "textAlign": "right",
  "borderBottomColor": "black",
  "borderBottomWidth": 2
}
@jacobp100
Copy link
Contributor

You can’t borders on text elements in react native

@resting
Copy link
Author

resting commented Apr 23, 2020

I'm on react-native 0.62. Looks like it's possible.
Have tried adding the style to the title on the docs
image

@jacobp100
Copy link
Contributor

The output you pasted looks fine, so we’re doing the right thing in this library

You can try putting that style directly into RN, because I think you can’t put borders on text and that the docs might be wrong

@resting
Copy link
Author

resting commented Apr 23, 2020

You're right. Sorry, the preview was on web.
Just realize my mistake when it shows on Android while testing it.
I suppose best practice now is to just use View instead. Thanks!

@jacobp100
Copy link
Contributor

Glad I could help - if only a little! 😄

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

No branches or pull requests

2 participants