textual.style
The Style class contains all the information needed to generate styled terminal output.
You won't often need to create Style objects directly, if you are using Content for output. But you might want to use styles for more customized widgets.
Style
dataclass
¶
Style(
background=None,
foreground=None,
bold=None,
dim=None,
italic=None,
underline=None,
reverse=None,
strike=None,
link=None,
_meta=None,
auto_color=False,
)
Represents a style in the Visual interface (color and other attributes).
Styles may be added together, which combines their style attributes.
background_style
cached
property
¶
Just the background color, with no other attributes.
rich_style
cached
property
¶
style_definition
cached
property
¶
Style encoded in a string (may be parsed from Style.parse
).
from_rich_style
classmethod
¶
from_rich_style(rich_style, theme=None)
from_styles
classmethod
¶
from_styles(styles)
Create a Visual Style from a Textual styles object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
StylesBase
|
A Styles object, such as |
required |
parse
classmethod
¶
parse(text_style, variables=None)