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

Rich Console Markup will count towards the total width of a widget #3918

Closed
kwevin opened this issue Dec 22, 2023 · 2 comments · Fixed by #3920
Closed

Rich Console Markup will count towards the total width of a widget #3918

kwevin opened this issue Dec 22, 2023 · 2 comments · Fixed by #3920

Comments

@kwevin
Copy link

kwevin commented Dec 22, 2023

Rich Console Markup will count towards the total width of a widget

Example:

class TestLabel(Label):
    DEFAULT_CSS = """
    TestLabel {
        width: auto;
        background: red;
    }
    """

    def render(self) -> RenderableType:
        return "this is a test [bold underline blue]and more[/bold underline blue]"


class TestApp(App[None]):
    def compose(self) -> ComposeResult:
        yield TestLabel()

will result in extra width.

image

Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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 a pull request may close this issue.

1 participant