Skip to content

Confusion regarding styling textΒ #93

@TJohnW

Description

@TJohnW

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions