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

Confusion regarding styling text #93

Open
TJohnW opened this issue Mar 26, 2019 · 0 comments
Open

Confusion regarding styling text #93

TJohnW opened this issue Mar 26, 2019 · 0 comments

Comments

@TJohnW
Copy link

TJohnW commented Mar 26, 2019

Hey, I'm hoping you could clear up some confusion I have around how text nodes are handled. Is the intent to always set styling on a text element and explicitly set the content prop of that element? I think I was expecting string child nodes to be set as the content of the parent.

<text fg="green">I'm not green!</text>
...
<text fg="green" content="I'm green!" />

I also tried to style my text nodes using the tag syntax but found that didn't work either:

<text bg="black">
  {`{blue-fg}Hello World!{/}`}
</text>

It looks like the latter can be accomplished by setting tags: true when react-blessed internally creates the text instances here https://github.com/Yomguithereal/react-blessed/blob/master/src/fiber/fiber.js#L102

@TJohnW TJohnW changed the title Allow tags on text nodes Confusion regarding styling text Mar 26, 2019
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

1 participant